             return -1
         }
         
+        self.pcmBuffer.removeFirst()
         ioNumberDataPackets.pointee = 1
         return noErr
     }

            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

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