Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sound file will not play using playsound module python error 259

from playsound import playsound

playsound("1.mp3")

The code above using the playsound module results in the following errors. How to resolve?

    Error 259 for command:
        play 1.mp3 wait
    The driver cannot recognize the specified command parameter.

    Error 263 for command:
        close 1.mp3
    The specified device is not open or is not recognized by MCI.
Failed to close the file: 1.mp3
Traceback (most recent call last):
  File "C:\Users\itsra\OneDrive\Desktop\Python\test.py", line 4, in <module>
    playsound("1.mp3")
  File "C:\Users\itsra\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\playsound.py", line 73, in _playsoundWin
    winCommand(u'play {}{}'.format(sound, ' wait' if block else ''))
  File "C:\Users\itsra\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\playsound.py", line 64, in winCommand
    raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
    Error 259 for command:
        play 1.mp3 wait
    The driver cannot recognize the specified command parameter.
like image 905
Anthony Lopez Avatar asked Jun 11 '26 22:06

Anthony Lopez


1 Answers

I also got the same problem. Try downgrading playsound version. Use

pip install playsound==1.2.2

This solved it.

like image 195
Nishani Kasineshan Avatar answered Jun 14 '26 10:06

Nishani Kasineshan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!