Optimization of multiple audio track synchronization.

I have an app where multiple audio files of the same length are played and they need to be in sync to produce the full song. My current setup syncs each track to the same position every time the user pauses or plays the song. However it is super laggy when the Audio is played either for the first time or when unpausing/pausing. What's the best way to do this?

Answered by Frameworks Engineer in 892003022

Hi @KaianthonydC,

There are a few ways to achieve this depending on the APIs you are using; however, this sample project may be of interest to you if you are using AVAudioEngine:

https://developer.apple.com/documentation/avfaudio/building-an-audio-sequencer-to-arrange-and-play-clips?language=objc

you can pre-buffer the audio around the playhead

Hi @KaianthonydC,

There are a few ways to achieve this depending on the APIs you are using; however, this sample project may be of interest to you if you are using AVAudioEngine:

https://developer.apple.com/documentation/avfaudio/building-an-audio-sequencer-to-arrange-and-play-clips?language=objc

Optimization of multiple audio track synchronization.
 
 
Q