redribben icon

bytesRead

redribben | PRO | 07/09/15 11:45:57 PM UTC | 0 ⭐ | 7863 👁️ | Never ⏰ | []
Objective C |

0 B

|

None

|

0 👍

/

0 👎

- (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");
        }
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎