📜  如何在 python 代码示例中使用语音识别

📅  最后修改于: 2022-03-11 14:45:24.712000             🧑  作者: Mango

代码示例2
import speech_recognition as sr
recognizer = sr.Recognizer()
microphone = sr.Microphone()
with microphone as source:
    recognizer.adjust_for_ambient_noise(source)
    audio = recognizer.listen(source)
    command = recognizer.recognize_google(audio)
    print(command)