i'm trying to get the float data of a realtime mic input with AVAudioEngine. To proceed a fft and a special algorithm after the fft.
When i compile the code im becoming this output on the console:0x0000000000000000
What i doing wrong? Many thanks for help
Here is my code to get the float data:
let audioEngine = AVAudioEngine()
override func loadView() {
super.loadView()
let inputNode = audioEngine.inputNode
let bus = 0
inputNode!.installTapOnBus(bus, bufferSize: 2048, format: inputNode!.inputFormatForBus(bus)) {
(buffer: AVAudioPCMBuffer!, time: AVAudioTime!) -> Void in
print(buffer.floatChannelData[50])
}
audioEngine.prepare()
do{
try audioEngine.start()
}catch{
print("Error")
}
}