Jump to content
  • Advertisement
Sign in to follow this  
Splinter of Chaos

[c++] SDL_Mixer and MP3 not a match?

This topic is 3932 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, I made my game, but people complained that the "music" file was outrageously huge--something like 12 MB. Anyway, I re-exported my music files into mp3s, but now the game freezes when I press any button. I have narrowed the problem down to it being the mp3, and SDL not liking them. My research backs this up. Is there anything I can do? Or is there at least another format I can work with?

Share this post


Link to post
Share on other sites
Advertisement
I vaguely remember a build of SDL_mixer not working with MP3s a year ago but I can't remember if it was for the GP2X port or the PC. A bit of Google searching may bring up some mailing lists.

In the meantime, use the OGG format.

Share this post


Link to post
Share on other sites
Use ogg vorbis files. They are supported by SDL mixer and have a similar compression size and quality to MP3s

Share this post


Link to post
Share on other sites
I've used an application called goldwave. There is a free "nagware" version of it on their website. It supports many file formats.

I might have had to install a seperate ogg vorbis encoder to be able to play ogg vorbis in windows media player though, but Ican't remember.

Share this post


Link to post
Share on other sites
I had similar problems with SDL_Mixer a year or two ago, and ended up switching to ogg vorbis. I just used oggdrop to encode to ogg, it's literally drag and drop.

Share this post


Link to post
Share on other sites
There still seems to be something wrong here.

        // The game is quit when you X out or pres ESC, but this makes
// sure that pressing ESC in-game doesn't quit you automatically
// when you get back to the menu.
while( SDL_PollEvent( &SDLevent ) )
{
if( SDLevent.type == SDL_QUIT || keyStates[ SDLK_ESCAPE ] )
{
appState = QUIT; // Just a char for holding a state.

errors << "Q has bee pressed. " << appState << endl;
}
errors << "After0\n";
}



I see no reason for it, but using ogg file formats make it so if I press escape, the program never makes it to the second testing output.

Any ideas?

Share this post


Link to post
Share on other sites
Quote:
Original post by Splinter of Chaos
How do I convert the audio?

Or, How do I take an MP3 or WAV and make it an oog?


use audacity

http://audacity.sourceforge.net/

pretty straightforward to do and its free

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!