0
0

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..

[code:22f5kao5]
result = system->playSound(FMOD_CHANNEL_FREE, sound1, false, &channel);
result = system->playSound(FMOD_CHANNEL_FREE, sound1, false, &channel2);
channel2->setPosition(20000,FMOD_TIMEUNIT_MS);
[/code:22f5kao5]

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?

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.