         }
         ogg_sync_clear(&syncState)
         
+        //TODO: - check this is the right place to deallocate pcmDataBuffer
+        pcmDataBuffer.deallocate(capacity: MemoryLayout<Float>.stride * Int(MAX_FRAME_SIZE) * Int(numChannels))
+        
     }
     
 
     private func extractPacket(_ streamState: inout ogg_stream_state, _ packet: inout ogg_packet) throws {
         
-        var pcmDataBuffer = UnsafeMutablePointer<Float>.allocate(capacity: 0)
         while (ogg_stream_packetout(&streamState, &packet) == 1) {
             /// Execute if initial stream header.
             if (packet.bytes >= 8 && packet.b_o_s == 256 && (memcmp(packet.packet, "OpusHead", 8) == 0)) {

//            print (packet.e_o_s)
        }
        
        //TODO: - check this is the right place to deallocate pcmDataBuffer
        pcmDataBuffer.deallocate(capacity: MemoryLayout<Float>.stride * Int(MAX_FRAME_SIZE) * Int(numChannels))
    }
    
    /// channels - used to __

                
            }
        }
        if totalLinks == 0 {
            NSLog("Does not look like an opus file.")
            
            throw OpusError.invalidState
