- (void) readStreamClientCallBackWithData:(CFReadStreamRef) stream withType:(CFStreamEventType) type { if(type == kCFStreamEventHasBytesAvailable) { UInt8 buffer[2048]; CFIndex bytesRead = CFReadStreamRead(stream, buffer, sizeof(buffer)); if (bytesRead < 0) { //nothing } // If zero bytes were read, wait for the EOF to come. else if (bytesRead) { // parse the data. this will call MyPropertyListenerProc and MyPacketsProc // AudioFileStreamParseBytes function called when you have data to pass to the parser. // Send the data to the parser sequentially and, if possible, without gaps. OSStatus err = AudioFileStreamParseBytes(_audioData->audioFileStream, bytesRead, buffer, 0); if (err) PRINTERROR("AudioFileStreamParseBytes"); } } }