#🔒 Error that I can't troubleshoot :/

4 messages · Page 1 of 1 (latest)

crude steppe
#
import speech_recognition as sr

listener = sr.Recognizer()

def takecommand():
    try:
        with sr.Microphone() as source:
            print("Listening...")
            voice = listener.listen(source)
            command = listener.recognize_whisper(voice)
            print(f"You said: {command}")
            return command
    except Exception as e:
        print("Failed to listen. Error:", e)
        return None

takecommand()

Trying to run this code but is resulting in Failed to listen. Error: [WinError 126] The specified module could not be found. Error loading "C:\Users\ikabb\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\lib\caffe2_nvrtc.dll" or one of its dependencies.

It's printing the Listening... thing, but it's not saying anything else other than that error. It should ideally record my audio, recognize it and then return what has been heard. I'm using the Whisper enginge by OpenAI on SpeechRecognition's library. Any idea how I can fix this error? I'm running torch v2.2.0 and torchvision 0.17.1 and I have a Windows PC with an AMD graphics card.

[This may be a dumb question, but I'm fairly new to Python, so yeah, sorry ;-; ]

frigid ermineBOT
#

@crude steppe

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

frigid ermineBOT
#

@crude steppe

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.