“A problem occurred in initializing MCI” playsound issues

こ雲淡風輕ζ 提交于 2021-01-27 11:50:23

问题


I'm trying to use playsound to play a file within the folder of my code, however very time I run my code it seems it is able to call the file however I always recieve this output:

playsound.PlaysoundException:

Error 277 for command:

open "para.mp3" alias playsound_0.9208788744295284

A problem occurred in initializing MCI.

The code that is run is just the use of the playsound function:

from playsound import playsound
playsound("01. Humongous.mp3")

I'm unsure if this is just an issue with my machine or something that I'm missing?


回答1:


Try removing the period from the filename you're playing and try again. I don't know what system you're running this on, but it might be interfering with the file reading process.




回答2:


Managed to fix it. After hours of ripping my hair out I eventually tried a different file to play and it worked. Not actually sure if there is a bitrate limit with the playsound library but it certainly didn't like that particular file. Tried another file with a lower bitrate and it worked fine.




回答3:


I also faced the same issue it is not with the bit rate of the file, it seems to be the tags in the music file like "track title, cover art, album name, encoding" and so on is causing it so I would like to recommend you to remove these tags and leave it as such, to do this editing I used mp3tag application you can get it from here. This worked for me. You can check instructables to know how to use this application to edit tags. If you want those tags you can type it out and check if again the problem arises if it does then don't add the tags.




回答4:


Convert the mp3 file to wav. Worked for me.




回答5:


In playsound,for (.mp3) you can't directly upload the customized mp3 file because of some issue in bit initailizaing.

To solve this issue, We need to change our .mp3 file to .mp3 format again on some audio converter application or online converter. Now converted mp3 file can be flawlessly accessed for playsound.playsound(dir/users/converted/song.mp3).Enjoy it..



来源:https://stackoverflow.com/questions/56627901/a-problem-occurred-in-initializing-mci-playsound-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!