Advertisement

SDL_mixer...

Started by December 22, 2004 02:03 AM
5 comments, last by Ryan Clark 20 years, 2 months ago
Hey guys I am trying to put sound effects in my game using SDL_Mixer and I have run into a problem. Whenever I play a small effect such a bullet firing, it works fine. However , whenever I tryto play music for the background, It wont play. Both files are in .wav format , and all I do is change the path to load from in my code but it won't work. I think it may have something to do with the file size of the sounds because the shot is 3kb but the background music is something,like 300 kb. Does anyone know why this is happening?
My Current Project Angels 22 (4E5)
SDL_Mixer has two types of structures, for sounds you are likely using Mix_Chunk, while for music you should be using Mix_Music, check out the docs for more info.
Advertisement
Maybe when you initialized the SDL_mixer API you set the chunk size too low? Or maybe the file isn't even loaded at all. Some runtime error checking certainly wouldn't hurt.
---http://www.michaelbolton.comI constantly dream about Michael Bolton.
Instead of meddling with SDL_Mixer, I'd suggest checking out FMod. It's very easy to use and very powerful.
Rob Loach [Website] [Projects] [Contact]
Quote:
Original post by Rob Loach
Instead of meddling with SDL_Mixer, I'd suggest checking out FMod. It's very easy to use and very powerful.

Aern't you supposed to be gone on vacation or something? Ignore Rob. You can't use fmod on a commercial project unless you purchase the license. AFAIK, SDL_Mixer is LGPL.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Uh, FMOD is great. Cheap shareware licenses and for anything commercial (US $100 if I remember right) it's also relatively cheap (several thousand US $).

Anyway, with no code it's sort of hard to help. You might try splitting up your music though because that is largish.
Advertisement
You're not loading both sounds with the same Mix_Chunk pointer, are you?

Please post some code! I'm certain we can help you :)


Ryan
--Visit the Game Programming Wiki!

This topic is closed to new replies.

Advertisement