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?
- agtunon asked 11 years ago
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.
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.
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.
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?
- identitycrisisuk answered 11 years ago
Please login first to submit.