0

I used from playsound import playsound and I tried running these two sounds in the same folder as the python folder.

playsound('insert.mp3')
playsound('beep.mp3')

The first sound played, but when it got to the second one it said.


Error 263 for command:
        open beep.mp3
    The specified device is not open or is not recognized by MCI.

    Error 263 for command:
        close beep.mp3
    The specified device is not open or is not recognized by MCI.
Failed to close the file: beep.mp3
Traceback (most recent call last):
  File "c:\Users\Name\Google Drive\Downloads\Jasosc\JasoPC.py", line 15, in <module>
    playsound('beep.mp3')
  File "C:\Users\Name\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 72, in _playsoundWin
    winCommand(u'open {}'.format(sound))
  File "C:\Users\Name\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 64, in winCommand   
    raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
    Error 263 for command:
        open beep.mp3
    The specified device is not open or is not recognized by MCI.
JasoPC
  • 15
  • 7

1 Answers1

1
  1. Do
pip uninstall playsound
  1. Then
pip install playsound==1.2.2
  1. Close your code editor, reopen and run
Muhammad Sulaiman
  • 2,399
  • 4
  • 14
  • 28
  • I have a question, what if I compile my program into an EXE and share it across the web will it still work because other computers may have a diff version not 1.2.2. – JasoPC Sep 05 '22 at 15:20
  • Other computers might not have this lib at all, so yes, it should work! – Muhammad Sulaiman Sep 05 '22 at 15:27
  • Do you know a way before any of my code runs, check to see if they have it? – JasoPC Sep 05 '22 at 15:29
  • The `exe` is a standalone app by itself, it has all the resourcese it needs when you generate it, do the following if you want: generate the `.exe`, run `pip uninstall playsound` on your machine, then run the `.exe` and see that it will run fine. – Muhammad Sulaiman Sep 05 '22 at 15:33