Pygame, more than a legend ?

Hi there,

It’s been now a while since peoples have started using pygame for their game’s sound.
Not so many though.
Once in a while you’ll heard someone saying he saw someone else using pygame.

So the question is : Is there a game/apps/demo/anything that exist somewhere and can be downloaded as a standalone application that will play .mp3 or .ogg musics files.

If anyone know anything related, please, link it here.

Well, the new Blender 2.5 supports mp3 and OGG formats…so it’ll be quite easy to make a little musical demo…
But maybe you’re talking about a "true player?!
Bye

I’m not entirely sure what you’re asking, but the pygame mixer module supports both .ogg and MP3. They use different methods though, .ogg and wav files can be loaded directly into memory (slower, but there are more functions available particularly multiple channels for playback) and then played. MP3’s need to use the mixer.music module which streams the sound data rather than loading it into memory (faster, but there’s only one playback channel), .ogg is also supported in the mixer.music module.

You can find out more here - this ebook covers both methods including an example making a music player. It’s all python based but the code should work in the BGE too.

Hope this helps.

thanks, il look into that.

To answer your original question, I can point you to a couple of games that used PyGame in standalones. I know there have been more, but I can’t think of which ones they are right now. However, as OTO pointed out, 2.5 supports .ogg and .mp3 natively, so you might rather just use that option.

We used PyGame for the sound in the standalone Linux build of Solomon’s Treasure. (Due to differences between Windows and Linux, please note that it is not unreasonable to require the user to install the python-pygame libraries for sound support.) I think I tried to make it work on Windows but was having some sort of trouble with Vista and how Blender was trying to access Python. Particularly, one of the libraries in the Python26.zip was throwing errors.

We also used PyGame for the standalone version of a game we never announced here, since it was never really in a finished or playable state. It was called UpRight. It also had the Vista problem, but it sometimes works on Windows XP, I think. It was a very rushed last minute build for a contest.

Thanks a lot for these resources blendenzo.

Il look into blender 2.5 to see if it’s worth the pain.

Il also take a look about the pygame option now that I have
some successful attempts to look at.
(Maybe I can solve the external python issue if I’m lucky enough)

Thanks again.

PS : I do not agree with you on the multi-installation aspect, but that’s just
regarding my preferences, some peoples may like to have all these
multiple post installations popping up after installing their game, but I’m
usually playing on computers that doesn’t have Internet access ( Yea,
no internet for me at home ) so I like a game that is just an unzip & play.

My game(Krum) is using pyGame for the sound.
Also look at this thread http://blenderartists.org/forum/showthread.php?t=187260&highlight=pyGame about the proper pyGame usage, it might be useful for you.