I was trying to code a voice assistant with the help of an online tutorial. When I tried to run the code, I kept kept getting an error message saying:
Error 263 for command:
close voice.mp3
The specified device is not open or is not recognized by MCI.
Failed to close the file: voice.mp3
*Note: "voice.mp3" is the name I gave to the mp3 file.
This is the only function in the program which used "voice.mp3", as well as the Playsound module:
def speak(text):
tts = gTTS(text=text, tld="ca", lang="en")
filename = "voice.mp3"
tts.save(filename)
playsound.playsound(filename)
I believe it has something to do with Playsound. Does anyone know how to fix this?