Advertisement

FMOD - play multiple sounds simultaneously?

Started by November 21, 2011 11:51 PM
-1 comments, last by neo187 13 years ago
I am trying to set up my Sound Manager (FMOD) to play a background music and other action sounds on different channels, as I understand that this is the only way of having simultaneous sounds with FMOD.... My setup is below, if I call `playRepeat` and then `playOnce` the first track stops!

void SoundMgr::addSound(char *path, string n){
Sound* s;
fmodsys->createSound(path, FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM, 0, &s);


soundMap.insert(pair<string,Sound*>(n, s));
}

void SoundMgr::playOnce(string name){

fmodsys->playSound(FMOD_CHANNEL_FREE,
soundMap.find(name)->second, true, &fmodchn);
fmodchn->setPosition(0, FMOD_TIMEUNIT_PCM);
fmodchn->setPaused(false);
}

void SoundMgr::playRepeat(string name){

fmodsys->playSound(FMOD_CHANNEL_FREE,
soundMap.find(name)->second, true, &backChn);
backChn->setMode(FMOD_LOOP_NORMAL);
backChn->setPosition(0, FMOD_TIMEUNIT_PCM);
backChn->setPaused(false);

}

...despite the fact that I AM using two separate channels.... am I missing something?

This topic is closed to new replies.

Advertisement