                                                          outBuffer.unsafeMutablePointer,
                                                          nil)
         
-            if status == noErr {
-                print("NO ERR")
+            switch status {
+            case noErr:
                 let aacPayload = Array(self.aacBuffer[0..<Int(outBuffer[0].mDataByteSize)])
                 onComplete(aacPayload, noErr)
-            } else {
+            case -1:
+                print("Needed more bytes")
+            default:
                 print("Error converting buffer:", status)
                 onComplete(nil, status)
             }

                ioData.pointee.mBuffers.mDataByteSize = pcmBufferSize
            }
            
            self.pcmBuffer.removeFirst()
            
        } else {
            ioNumberDataPackets.pointee = 0
            return -1

            self.aacBuffer = [UInt8](repeating: 0, count: Int(pcmBufferSize))
            
            let outBuffer:UnsafeMutableAudioBufferListPointer = AudioBufferList.allocate(maximumBuffers: 1)
            outBuffer[0].mNumberChannels    = self.outASBD == nil ? 1 : self.outASBD!.mChannelsPerFrame
            outBuffer[0].mDataByteSize      = pcmBufferSize
            
            self.aacBuffer.withUnsafeMutableBytes({ rawBufPtr in
                let ptr = rawBufPtr.baseAddress
