playsound icon indicating copy to clipboard operation
playsound copied to clipboard

Windows: Error 261 for command: The driver cannot recognize the specified command

Open fireattack opened this issue 3 years ago • 5 comments

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.

fireattack avatar Oct 09 '21 07:10 fireattack

Yeah I'm on Windows 10 and I'm also seeing the same error.

ddmee avatar Dec 09 '21 19:12 ddmee

same issue.

Per Stack Overflow, you need to pip install playsound==1.2.2 to make it to work

tangruixun avatar Feb 01 '22 11:02 tangruixun

after install pip install playsound==1.2.2 it shows error

File "e:\Apaarmeet\python\chapter1\play sound module.py", line 2, in playsound("E:\Apaarmeet\python\play.wav") File "C:\Users\apaar\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 35, in _playsoundWin winCommand('open "' + sound + '" alias', alias) File "C:\Users\apaar\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 31, in winCommand
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

Apaarmeet avatar Feb 28 '22 16:02 Apaarmeet

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.

raydrak64 avatar Oct 10 '22 23:10 raydrak64

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.

DrCta avatar Dec 04 '22 17:12 DrCta