I'm using Swift 4 with the AudioKit Framework 4.0.4.
I'd like to track the frequency of the input microphone of my iOS device in real time.
Currently I'm using a timer calling the output-function that prints out oscillator.frequency
every 0.1 seconds.
let timer = Timer.scheduledTimer( timeInterval: 0.1, target: self, selector: #selector(self.output), userInfo: nil, repeats: true)
func output() {
print("Frequency: \(oscillator.frequency)")
}
But is there a way to just listen for the change of the oscillator.frequency
struct? Maybe something like an event called every time if the oscillator.frequency
was changed.