I am trying to make an alarm clock for school project. I saw tutorials of the same and found out about playsound library. In the video it worked fine even when the path was not of root directory, but that is not the case with me.
this works:
from playsound import playsound
playsound('C:/final.wav')
but this does not:
from playsound import playsound
playsound('C:/a/final.wav')
similarly, D:/final.wav
works but not D:/Download/final.wav
This is the error:
Exception has occurred: PlaysoundException
Error 259 for command:
play C:/a/final.wav wait
The driver cannot recognize the specified command parameter.
File "D:\vs code\testo.py", line 2, in <module>
playsound('C:/a/final.wav')
I have tried:
- putting
//
or\
instead of/
in the path - making sure the permissions for the folders are right (they are same as root directories)
- putting the audio file in same directory as the code and just typing
playsound('final.wav')
, and it works.