Reputation: 197
I am trying to play sound in Python. When I run my code, it finishes successfully but the audio is not played by my computer.
I have tried with all the libraries like playsound, simpleaudio, pydub and kivy core audio.
Sample code I tried is:
from playsound import playsound
playsound('myfile.wav')
Upvotes: 2
Views: 1669
Reputation: 76
I've had this problem before, use the complete path:
from playsound import playsound
playsound(r"C:\some\path\sound.mp3") # the "r" is necessary, or else your code wont work!
Upvotes: 0
Reputation: 9
As i think it should work, check either your audio file (maybe it's empty) or check your audio drivers and audio output.
OR, You can try
pip install playsound one more time
Upvotes: 0