2

我想要一个快速的离线语音识别器(如 vosk 或 sphinx)作为谷歌语音识别的唤醒词,所以它并不总是能听到我们说的话。

想要唤醒这个词:

def takeCommand():
# mic input

r = sr.Recognizer()
with sr.Microphone() as source:
    print("Hearing...")
    # r.pause_threshold = 1
    r.chunk_size = 2048
    r.adjust_for_ambient_noise(source)
    audio = r.listen(source)

try:
    print("Recognizing....")
    query = r.recognize_google(audio, language='en-in')
    print(f"You said: {query}\n")

except Exception as e:
    print(e)

    print("Say that again please...")
    return "None"
return query
4

1 回答 1

0

看看 PicoVoice 提供的 Porcupine 唤醒词引擎: https ://picovoice.ai/docs/porcupine/

它易于使用并允许训练您自己的唤醒词。

于 2022-02-23T14:54:44.707 回答