Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The specified device is not open or is not recognized by MCI

I was programming a game using Python and a sound effect needed to be played, so I used the playsound module:

from playsound import playsound

playsound("Typing.wav", False)

And when I attempted the run the program this error was returned:

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

I did some research and some sources indicated that it was an issue with my sound drivers. I updated & reinstalled it, but the issue persists. Is there any way to solve this?

like image 323
Richard Su Avatar asked Sep 11 '25 13:09

Richard Su


2 Answers

I faced this problem too firstly as mentioned in the previous comments I downgraded my python version from 3.10 to 3.7 and yet the problem persisted. So what actually worked is that the recent versions of playsound are giving such errors in order to fix this run the following commands in cmd as admin

pip uninstall playsound

pip install playsound==1.2.2

and this should do the work.

just in case that doesn't work try degrading your python version to 3.7 and run these commands and that should be good.

like image 167
Jai advith Avatar answered Sep 14 '25 05:09

Jai advith


I had this same problem and fixed it using

audio_file = os.path.dirname(__file__) + 'audio.mp3'
playsound(audio_file)
like image 40
felipecapp Avatar answered Sep 14 '25 05:09

felipecapp