Home AudioKit AKSequencer does not loop on iOS 10
Reply: 0

AudioKit AKSequencer does not loop on iOS 10

user780
1#
user780 Published in July 23, 2018, 1:32 pm

The following code plays multiple audio files in a loop in iOS 11 but not in iOS 10. Seems like that AKSequencer cannot loop in iOS 10?

let mixer = AKMixer()
var sequencer: AKSequencer = AKSequencer()
sequencer.loadMIDIFile(fromUrl: URL(fileURLWithPath: midiFile))

for index in 0..<sequencer.tracks.count {
    let musicTrack: AKMusicTrack = sequencer.tracks[index]
    let sampler = AKMIDISampler()

    if index < samples.count {
        sampler.loadWavFromAbsolutePath(samples[index])
        sampler.enableMIDI(midi.client, name: "Sampler_\(index)")
        mixer.connect(input: sampler)
    }
    musicTrack.setMIDIOutput(sampler.midiIn)
}

AudioKit.output = mixer
AudioKit.start()
sequencer.enableLooping()
sequencer.play()
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.596978 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO