【问题标题】:Not able to Run Speech Recognition Code Due to some error [duplicate]由于某些错误,无法运行语音识别代码[重复]
【发布时间】:2021-10-02 18:17:30
【问题描述】:

这是我在成功安装必要的库后为语音识别编写的代码。

import speech_recognition as sr
import pyttsx3

r = sr.Recognizer()

with sr.Microphone() as source:
    print('Please Speak: ')
    audio = r.listen(source)
    try:
        text = r.recognize_google(audio)
        print(f'Did you told: {text}')

    except:
        print('Could not understand')

我无法理解这些可怕的错误是什么意思。反复安装 pyaudio 但这不起作用。 enter image description here

这是安装 pyaudio 时得到的礼物。 enter image description here

【问题讨论】:

标签: python pycharm speech-recognition pyaudio


【解决方案1】:

根据我自己的经验,直接通过 pip 安装 pyaudio 是行不通的。这个thread 的最佳答案(由 Foad 提供)对我有用。

【讨论】:

    猜你喜欢
    • 2016-09-10
    • 1970-01-01
    • 2018-06-29
    • 2022-08-09
    • 1970-01-01
    • 2022-01-21
    • 2014-06-08
    • 1970-01-01
    • 2021-04-10
    相关资源
    最近更新 更多