0
0

Hello,

I have two ogg streams that need to stay in sync, but I only want to hear one at a time. It is obvious that I could simply play both and silence one when I unsilence another. My question is:

Is it possible to keep them in sync without actually incurring the CPU hit of decoding the inaudible ogg?

  • Alejandro
  • You must to post comments
0
0

You might try doing a Channel::getPosition(&position, FMOD_TIMEUNIT_PCM) and then play your other Ogg, and do a Channel::setPosition(position, FMOD_TIMEUNIT_PCM).

A quick crossfade will also help cover up any slight incongruities, too.

  • G
  • You must to post comments
0
0

Thanks for the suggestion. Unfortunately, this is not an option as setPosition causes the buffers to flush, resulting in a skip in the audio.

Basically, what I’m looking for is a way to have both streams move along in time as normal, but not need to decode the one that is not playing. I’m not sure if something like that is possible.

  • Alejandro
  • You must to post comments
0
0

If you pre-prepare them (ie simply open them so they are ready), then start them paused, and unpause them inside System::lockDSP/System::unlockDSP they will start at identical times. They have to be created with FMOD_SOFTWARE of course for this to work.

  • You must to post comments
0
0

I think he’s more concerned with the CPU hit of 2 streams at once when only one of them can be heard. As far as I know, with the latest version if one is silenced it will become virtual and only update its position, taking away the CPU hit – am I right?

  • You must to post comments
0
0

That’s right, but i can’t guarantee perfect sync after voices swap in and out of being virtual/real. They use system time to work out where to swap back in etc, which is not sample accurate.

FMOD_INIT_VOL0BECOMES_VIRTUAL would take away the cpu hit if you set one voice to 0 volume.

  • You must to post comments
0
0

Thanks for the advice. Which version of FMOD Ex is required to use FMOD_INIT_VOL0BECOMES_VIRTUAL? The version I’m using doesn’t seem to have this flag defined anywhere.

  • Alejandro
  • You must to post comments
0
0

Its a 4.07 dev branch feature.

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.