Playing multiple mono files in sync as if they were one file


If I have poly wave files split into monos, how can I recombine them virtually to play in sync as if they were the original poly file?




It depends on what you mean by “as if they were the original poly file.”

If you ensure that the instruments containing the audio files are triggered at the same time - for example, by putting them all on separate audio tracks at position 0:00:000 on the timeline so that they all start when the event does - and the assets are not set to stream, the audio files will start playing in perfect sync.

Ensuring that each audio file goes to a specific channel is slightly more complex. You’ll need to ensure each audio track’s output is upmixed and distributed evenly to all channels by right-clicking on the track input meters in the deck and selecting your target format from the context menu; then you’ll need to add an FMOD Channel Mix effect to each audio track that uses the same grouping and use it to silence every channel except the specific one that particular audio file is meant to play through.

The signal from each audio track in the event will be mixed together into the master track, so the event’s output will be of all the audio files playing in sync through the appropriate speakers.



Thanks. To clarify, Im talking about the API only. Using FMOD in an audio app.



you can use Channel::setDelay to schedule all your mono sounds at the same time in the future.
Use the current system DSP clock, then add a bit, ie a few mix blocks worth, so if the mix block size is 1024 , add 2048 or 3072 for example , it depends how slow the code is that is playing the sounds.

Alternatively you can stall the whole mixer with a mutex lock, use System::lockDSP and unlockDSP around your playsound logic.