         ioData: UnsafeMutablePointer<AudioBufferList>,
         outDataPacketDescription: UnsafeMutablePointer<UnsafeMutablePointer<AudioStreamPacketDescription>?>?) -> OSStatus
     {
-        print(#function)
         let requestedPackets = ioNumberDataPackets.pointee
         self.pcmBuffer.withUnsafeMutableBufferPointer { bufferPtr in
             let ptr                              = UnsafeMutableRawPointer(bufferPtr.baseAddress)
             ioData.pointee.mBuffers.mData        = ptr
             ioData.pointee.mBuffers.mDataByteSize = self.pcmBufferSize
-            print(ioData)
         }
         
         if self.pcmBufferSize < requestedPackets {
-            print("Fuck")
             ioNumberDataPackets.pointee = 0
             return -1
         }
         
-        print("Next")
         ioNumberDataPackets.pointee = 1
         return noErr
     }
-    
-
-    // http://stackoverflow.com/questions/10817036/can-i-use-avcapturesession-to-encode-an-aac-stream-to-memory
-    private func getAudioClassDescription(with type: UInt32,
-                                          from manufacturer: UInt32) -> AudioClassDescription?
-    {
-        var status = noErr
-        
-        var encoderSpec: UInt32 = type
-        var size: UInt32 = 0
-        status = AudioFormatGetPropertyInfo(kAudioFormatProperty_Encoders,
-                                            type,
-                                            &encoderSpec,
-                                            &size)
-        
-        if status != noErr {
-            print("Error getting audio format property", status)
-            return nil
-        }
-        
-        var descriptions: [AudioClassDescription] = []
-        status = AudioFormatGetProperty(kAudioFormatProperty_Encoders,
-                                        type,
-                                        &encoderSpec,
-                                        &size,
-                                        &descriptions)
-        
-        if status != noErr {
-            print("Error getting audio format property", status)
-            return nil
-        }
-        
-        for descriptor in descriptions {
-            if descriptor.mSubType == type && descriptor.mManufacturer == manufacturer {
-                return descriptor
-            }
-        }
-        
-        return nil
-    }
-    
 }

                outASBD.mBitsPerChannel     = 0
                outASBD.mReserved           = 0
                
//                #if os(macOS)
                    let status = AudioConverterNew(&inASBD, &outASBD, &audioConverter)
                    if status != noErr { print("Failed to setup converter:", status) }
//                #else
//                if var descriptor = self.getAudioClassDescription(with: kAudioFormatMPEG4AAC,
//                                                                  from: kAppleSoftwareAudioCodecManufacturer) {
//
//                    let status = AudioConverterNewSpecific(&inASBD,
//                                                           &outASBD,
//                                                           1,
//                                                           &descriptor,
//                                                           &audioConverter)
//                    if status != noErr { print("Failed to setup converter:", status) }
//
//                }
//                #endif

            }
        }
    }

        
            if status == noErr {
                let rawAAC = Data(self.aacBuffer)
                print(self.aacBuffer)
                onComplete(rawAAC, noErr)
            } else {
                print("Error converting buffer:", status)
