Search code examples
swiftavaudioplayerplaybacksimultaneous

AVAudioPlayer Play Multiple Players Simultaneously


I am writing an app that plays back chords, like C Major, D minor, etc. by playing each note. A problem I'm running into is that, despite initializing and pre-setting the AudioPlayers beforehand including .prepareToPlay, they don't play simultaneously - almost, but not quite - the delay is fractions of a second but still perceptible. Is there a way to have them all start at the same time?

Thanks


Solution

  • I ended up just using objectAL, which was kind of annoying but a lot smoother. I recommend that for anyone trying to do complicated audio work, who doesn't mind learning objective-c. http://kstenerud.github.io/ObjectAL-for-iPhone/