0

Does the playsound module work in Python 3.9.1? When I write the command:

from playsound import playsound
playsound('C:\\Users\\acer\\Desktop\\FOLDER\\Programming\\Python\\01_project\\Bella Ciao.mp3')

it doesn't run and shows the error message A problem occurred in initializing MCI. But after that I have installed Python 3.5.0 and in that plays the sound without any error. So is the playsound module supported for Python 3.5.0 and not for 3.9.1? And also tell me other ways of inserting .mp3 files.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Choco-Lava
  • 29
  • 3
  • Does this answer your question? ["A problem occurred in initializing MCI" playsound issues](https://stackoverflow.com/q/56627901/6045800) – Tomerikoo Oct 10 '21 at 09:10

3 Answers3

1

As you can see from the pypi.org here ==> playsound 1.2.2

enter image description here

At the moment it supports only up to Python 3.5.0 .

Regarding your question of other ways to Play a mp3 sound in Python, I can suggest you to have a look at this other StackOverflow Answer ==> Playing mp3 song on python.

Playsound is good options by the way.

Federico Baù
  • 6,013
  • 5
  • 30
  • 38
1

What may help is rolling back to an older version of playsound. You can do this by opening your command prompt and typing the following:

pip install playsound==1.2.2

This will roll back the version of your playsound module to an older 1.2.2 version. Also, playsound was made for older versions of python, and seems to be buggy in the newer versions(versions>3.8).

1

Try converting the audio file from mp3 to wav

yorbby
  • 21
  • 7
  • If you have a new question, please ask it by clicking the [Ask Question](https://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/late-answers/30638364) – garg10may Dec 21 '21 at 04:18
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 21 '21 at 06:38