Sorry for my English but I’m french….
I have an external sound card with multiple audio output (* 10). I want to read two audio file at the same time but send it to two different output. Must file playback is synchronized and does not shift. The audio output recognized as the number of sound card. It’s possible or not possible with Fmod Ex?
- DJOULE049 asked 5 years ago
You would have to use 2 System objects and load the sound for each system object (or load the sound once into ram, and then use FMOD_OPENMEMORY_POINT).
You would have to synchronize them manually, maybe with Channel::setDelay, by using an offset created by comparing the 2 System::getDSPClock values.
You should only have to sync them when you start playing.
You could get an offset or just lock both dsps and schedule the channels to start sometime in the future. On both approaches you only need to sync once per play.
Have in mind that if you start more than one system they do not share the DSPClock and that is why you have to get an offset or schedule ahead.
Some example C# code that might put you in the right direction (not tested but I’m sure this wont compile 😉 ):
FMOD.System systemA = null;
FMOD.System systemB = null;
//Initialize systems pointing to your outputs. //Start your channels paused. systemA.playSound(CHANNELINDEX.FREE, yourSoundA, true, ref channelA); systemB.playSound(CHANNELINDEX.FREE, yourSoundB, true, ref channelB); systemA.lockDSP(); systemB.lockDSP(); systemA.getDSPClock(ref hiA, ref lowA); systemB.getDSPClock(ref hiB, ref lowB); //Lets schedule both to start in 448000 samples from now. DELAYTYPE_UTILITY.FMOD_64BIT_ADD(ref hiA, ref loA, ref 0u, ref 448000u); DELAYTYPE_UTILITY.FMOD_64BIT_ADD(ref hiB, ref lowB, ref 0u, ref 448000u); channelA.setDelay(DELAYTYPE.DSPCLOCK_START, hiA, loA); channelB.setDelay(DELAYTYPE.DSPCLOCK_START, hiB, lowB); systemA.unlockDSP(); systemB.unlockDSP();
Please login first to submit.