playsound
playsound copied to clipboard
Windows: Error 261 for command: The driver cannot recognize the specified command
Regression of 1.3.0. I suppose this should have been known, but searching "261" found nothing in tickets.
Many users report the same on SO: https://stackoverflow.com/questions/68704443/python-playsound-error-261-for-command-the-driver-cannot-recognize-the-specifie
from playsound import playsound
playsound('C:\\Users\\Rohit\\Desktop\\Python\\file.mp3')
Traceback (most recent call last):
File "c:/Users/Rohit/Desktop/Python/2Python.py", line 3, in <module>
playsound('C:\\Users\\Rohit\\Desktop\\Python\\file.mp3')
File "C:\Users\Rohit\AppData\Local\Programs\Python\Python38\lib\site-packages\playsound.py", line 72, in _playsoundWin
winCommand(u'open {}'.format(sound))
File "C:\Users\Rohit\AppData\Local\Programs\Python\Python38\lib\site-packages\playsound.py", line 64, in winCommand
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 261 for command:
open "C:\Users\Rohit\Desktop\Python\file.mp3"
The driver cannot recognize the specified command.
Yeah I'm on Windows 10 and I'm also seeing the same error.
same issue.
Per Stack Overflow, you need to pip install playsound==1.2.2
to make it to work
after install pip install playsound==1.2.2 it shows error
File "e:\Apaarmeet\python\chapter1\play sound module.py", line 2, in
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 275 for command:
open "E:\Apaarmeet\python\play.wav" alias playsound_0.6500178447702448
Cannot find the specified file. Make sure the path and filename are correct
I got error 259 with the same ending that the driver won't recognize a command. I did as it said on Stack Overflow and installed 1.2.2 and works brilliantly.
1.2.2 seems to have a memory leak when playing sounds. I had a short clip playing in a loop, and the memory usage quickly built up to 58 MB (39 MB in task manager) before failing to play any more sounds with error 264: Not enough memory available for this task.
1.3.0 on the other hand doesn't play any sounds at all, with error 261.
There is a pull request open that might fix these issues, I'm going to test this now.