我正在使用AKMIDISampler的一首曲目处理AKSequence:
var instrument1 = AKMIDISampler()
mixer.connect(input: instrument1, bus: 0)
sequencer.tracks[0].setMIDIOutput(instrument1.midiIn)
需要像这样导出到wav:
let audioFile = try! AKAudioFile(forWriting: fileURL, settings: settings)
try! AudioKit.renderToFile(audioFile, seconds: seconds, prerender: {
self.sequencer.play()
}
return fileURL
生成的音频文件只是第一个音符。怎么了?