我目前正在使用AudioKit的AKSamplerMetronome来生成和播放节拍器声音,现在我需要实现一个回调函数来获取当前节拍,假设我有5个节拍,我需要获取当前正在播放的节拍,以便我可以根据节拍计数添加一些更多的功能。是否有可用的回调函数来实现它??
这是我的当前代码:
这是我的当前代码:
// using AKSamplerMetronome
var metronome1 = AKSamplerMetronome()
var mixer = AKMixer()
// first sound called
let beatstart = Bundle.main.url(forResource: "mybeat", withExtension: "wav")
// other sounds based on beat count
let beaten = Bundle.main.url(forResource: "others", withExtension: "wav")
// setting first sound and other beat sounds
metronome1.sound = McountSoundUrl
metronome1.downBeatSound = MoneSoundUrl
metronome1 >>> mixer
AudioKit.output = mixer
AudioKit.start()