pygame.error: Unrecognized music format - OSX 10.12
Hello, i have an problem on my mac. i cannot play any mp3 file, ogg runs perfect.
import pygame import time pygame.init() pygame.mixer.init() pygame.mixer.music.load('Test.mp3') pygame.mixer.music.play() while pygame.mixer.music.get_busy(): time.sleep(100)
pygame.mixer.music.load('Test.mp3') pygame.error: Unrecognized music format
I tested it in python 2 and 3.
Step: brew install python3 hg sdl sdl_image sdl_ttf portmidi smpeg
Step: pip3 install hg+
I also try to compile sdl_mixer by my own, like this issues:
tar zxvf SDL_mixer-1.2.12.tar.gz cd SDL_mixer-1.2.12 ./configure make sudo make install
Nothing solved my issues.
In the output of
./configure, look for a line about SMPEG. Does it say it's found SMPEG? It needs to compile against that to support MP3.
i restarted it :
Thanks.
brew deinstall all.
brew install hg sdl etc ...
THEN compile sdl_mixer and then pip3 install pygame
and it works!
sorry i must reopen this. It playes, but only same file - not all mp3s. But if an mp3 is not playing, no error message is showing?
pygame.mixer.music.get_busy() returns directly 0 ?
Any Idea to fix it or to check it?
Sorry, no idea about that.
For future reference, if you run into another problem, it's probably better to open a new issue rather than reusing one that you resolved. It's clearer for people following the discussion that way.
smpeg doesn't work with all mp3s. It's best to choose .ogg for your music files.
Thanks for Feedback,
is there an alternative to smpeg oder another python lib to play all mp3´s. In my project is ogg no alternative, unfortunately
We are on github now.