If i want to play the same sound file in two channels simultaneously (at different positions) within the file, do i really need to create two sound objects? I tried creating one and doing this..
result = system->playSound(FMOD_CHANNEL_FREE, sound1, false, &channel);
result = system->playSound(FMOD_CHANNEL_FREE, sound1, false, &channel2);
So, i would expect it to be playing in channel at the beginning and in channel2 20 seconds in.. However, it only plays the last channel i created with playSound. Is there a way that i can invoke my desired behaviour?
- nakkytar asked 10 years ago
Looks like you want to play a streaming file.
If you do directly playSound() without any preparation (getOpenState() polling, after createSound()) then FMOD would play the file once it’s ready.
What you have to do in the general case (even for non-streaming files on certain platforms, or certain formats) is to make sure that after creating the sound you call getOpenSound( &openState, &percentBuffered, &isStarving ) and once openState returns you FMOD_OPENSTATE_READY then when you do PlaySound() it would start instantenously.
If you are using a stream, then yes you have to create it twice. A stream can’t share a file pointer and stream buffer simultaneously, they need their own.
If it was a static sample or compressed sample you could do what you want, but streams are different.
Please login first to submit.