funcrecordingCallback(inRefCon:UnsafeMutableRawPointer,ioActionFlags:UnsafeMutablePointer<AudioUnitRenderActionFlags>,inTimeStamp:UnsafePointer<AudioTimeStamp>,inBusNumber:UInt32,inNumberFrames:UInt32,ioData:UnsafeMutablePointer<AudioBufferList>?)->OSStatus{varstatus=noErrletchannelCount:UInt32=1varbufferList=AudioBufferList()bufferList.mNumberBuffers=channelCountletbuffers=UnsafeMutableBufferPointer<AudioBuffer>(start:&bufferList.mBuffers,count:Int(bufferList.mNumberBuffers))buffers[0].mNumberChannels=1buffers[0].mDataByteSize=inNumberFrames*2buffers[0].mData=nil// get the recorded samplesstatus=AudioUnitRender(AudioController.sharedInstance.remoteIOUnit!,ioActionFlags,inTimeStamp,inBusNumber,inNumberFrames,UnsafeMutablePointer<AudioBufferList>(&bufferList))if(status!=noErr){returnstatus;}letdata=Data(bytes:buffers[0].mData!,count:Int(buffers[0].mDataByteSize))DispatchQueue.main.async{AudioController.sharedInstance.delegate.processSampleData(data)}returnnoErr}