我正在使用语音识别模块,但它给了我这个错误 ModuleNotFoundError:没有名为“aifc”的模块

问题描述 投票:0回答:1
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
    print("Talk")
    audio_text = r.listen(source)
    print("Time over, thanks")
    try:
        print("Text: "+r.recognize_google(audio_text))
    except:
         print("Sorry, I did not get that")
Traceback (most recent call last):
  File "c:\Users\LEGION\Desktop\sp.py", line 1, in <module>
    import speech_recognition as sr
  File "C:\Users\LEGION\AppData\Roaming\Python\Python313\site-packages\speech_recognition\__init__.py", line 7, in <module>
    import aifc
ModuleNotFoundError: No module named 'aifc'

我不知道这里发生了什么。我还重新安装了库和 python,但我给了我同样的错误,所以请帮助我!

python speech-recognition
1个回答
0
投票

DeprecationWarning:'aifc' 已弃用并计划在 Python 3.13 中删除

© www.soinside.com 2019 - 2024. All rights reserved.