如何在python中使用mac的语音识别

Chr*_*ler 4 python macos terminal speech-recognition

有一个很棒的威胁,展示了如何在 python 中使用来自 mac 的 say-command: Macintosh 中的 Python Text to Speech

语音识别有什么类似的吗?我想使用来自 mac 的德语语音识别来获取用户输入。

这个问题的其他可能答案是 Python 中的德语语音识别。

最好的事物

SAM*_*AMO 5

这会起作用,并且 SpeechRecognition 包将处理德语

import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
   audio = r.listen(source)
Run Code Online (Sandbox Code Playgroud)