Jump to content
  • Advertisement
Sign in to follow this  

[SDL] Problems looping with SDL_mixer

This topic is 3854 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

Hi. I'll post the code we're working with tomorrow, but I don't think you need it to answer this question. Once before, we used title music that looped perfectly in general audio playing software, and from looking at the wav, you could see that there was no silence or gap at the end or beginning. Basically, SDL_mixer inserted a little blip of silence between playback when the ogg was on autoloop. We had the same problem with a different game using our newer engine and SDL_mixer is creating this audio glitch again. This time, it's more than just title music. The concept is similar to but not as complex as the bgm in games like Every Extend Extra. The complexity of the music increases as the game's difficulty increases. Since we're not autolooping, we thought the problem wouldn't occur, but even when SDL has to play a certain number of tracks in an order depending upon the player's progress (if you don't make it to the next level, it loops on that level's sound, but if you do make it to the next level, it waits for that sound to end and appends it with the next one). It chooses the sounds in the right order and plays them correctly, just with the blip in between. We tried automatically setting a delay to 5 milliseconds thinking it might override SDL's handling, but the delay was still more like half a second. We then decided that perhaps it was having trouble decompressing the ogg files and it was slowing it down, but the same thing happened when we switched to mp3s. Tomorrow, I'm going to suggest we try with wavs, although we won't accept that as a solution because they are too large for an easily distributable puzzle game, and I'm going to suggest that we try the files as sound effects instead of as music, because direct sound might handle it better. Unfortunately, I don't think this is a directsound problem. I've seen other people post about this regarding oggs and midis, but there haven't been any responses. The same thing happens in fullscreen and windowed mode, so it's not like the computer doesn't have enough resources to function properly. We aren't even maxing out the CPU with this one. As I said, I'll post some of the code tomorrow afternoon (even though it's my birthday and I think I might rather be eating cake ;_; ). I want to see if anyone has come up with a solution to this, because the idea of writing our own ogg-handling library is both daunting and a pain in the ass.

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!