"A problem occurred in initializing MCI" playsound issues
Asked Answered
R

5

7

I'm trying to use playsound to play a file within the folder of my code, however every time I run my code it seems it is able to call the file however I always receive 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?

Rosner answered 17/6, 2019 at 8:53 Comment(1)
Is the .mp3 playable in another player? I faced the same issue when using GIT LFS, and realized the file was actually not fully checked out and thus unplayable.Richey
I
7

Convert the mp3 file to wav. Worked for me.

Immigrate answered 19/5, 2020 at 14:22 Comment(2)
File in wav format takes much more space and because of it may not be preferred by user.Bink
After trying 5 other packages, this was actually the best answer for me.Oppugnant
C
2

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.

Cyrstalcyrus answered 5/5, 2020 at 8:44 Comment(0)
R
1

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.

Rosner answered 4/9, 2019 at 11:25 Comment(0)
I
0

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.

Insurable answered 20/6, 2019 at 17:56 Comment(0)
A
-2

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..

Adelia answered 22/1, 2021 at 6:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.