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.
Phind first said I need to install CUDA but I have an AMD system so NVIDIA products won't work. Then Phind told em to use CPU-Only PyTorch libraries and told me to run this in terminal: pip install torch==1.10.0+cpu torchvision==0.11.1+cpu torchaudio===0.10.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html but it has told me to replace the version numbers with the ones compatible for my project. Any idea how I get the compatible version numbers of my project and how to change it accordingly?
[This may be a dumb question, but I'm fairly new to Python, so yeah, sorry ;-; ]