cannot play samples more than once
Posted: Thu Dec 24, 2009 4:46 pm
Hi,
I'm currently fighting with MaxMod. The basic demo compiles and works OK, I can even change the sounds and put my .wav files instead and it works.
I've tried to do the same in my game. I'm loading the soundbank from the filesystem OK
Here's my C++ code
mmInitDefault((char*)soundbank_file.c_str());
mmLoadEffect(SFX_ARGH);
mmLoadEffect(SFX_GAME_OVER);
debug("Playing ARGH");
int a = mmEffect(SFX_ARGH);
GsTime::wait(1000); // wait 1 second
mmEffectCancel(a);
debug("Playing GAME OVER");
mmEffect(SFX_GAME_OVER);
GsTime::wait(1000);
It works, but if I don't cancel the effect, the second effect does not play!! It does not work 2 times! If I cancel the second SFX it keeps on playing, and no more sfx play afterwards!!!! what am I doing wrong??
I don't understand, since the example plays 2 sounds perfectly.
I'm using maxmod from devkitpro 1.5. Are there some updated versions with less bugs?
thanks
EDIT: I found the problem: I was using SDL with only video set (sound broken now on recent devkits): I patched SDL so it does not install IRQs and everything works all right!!!!
I'm currently fighting with MaxMod. The basic demo compiles and works OK, I can even change the sounds and put my .wav files instead and it works.
I've tried to do the same in my game. I'm loading the soundbank from the filesystem OK
Here's my C++ code
mmInitDefault((char*)soundbank_file.c_str());
mmLoadEffect(SFX_ARGH);
mmLoadEffect(SFX_GAME_OVER);
debug("Playing ARGH");
int a = mmEffect(SFX_ARGH);
GsTime::wait(1000); // wait 1 second
mmEffectCancel(a);
debug("Playing GAME OVER");
mmEffect(SFX_GAME_OVER);
GsTime::wait(1000);
It works, but if I don't cancel the effect, the second effect does not play!! It does not work 2 times! If I cancel the second SFX it keeps on playing, and no more sfx play afterwards!!!! what am I doing wrong??
I don't understand, since the example plays 2 sounds perfectly.
I'm using maxmod from devkitpro 1.5. Are there some updated versions with less bugs?
thanks
EDIT: I found the problem: I was using SDL with only video set (sound broken now on recent devkits): I patched SDL so it does not install IRQs and everything works all right!!!!