User defined CD data callback function.
void CALLBACK CDDataProc( HSTREAM handle, int pos, DWORD type, const void *buffer, DWORD length, void *user );
handle | The CD stream that provided the data. | ||||
pos | The stream position (in bytes) that the data is from. | ||||
type | The type of data, which can be one of the following.
| ||||
buffer | Pointer to the data. | ||||
length | The amount of data in bytes. | ||||
user | The user instance data given when BASS_CD_StreamCreateEx or BASS_CD_StreamCreateFileEx was called. |
CDs are read from in units of a frame, and so this function will always receive a whole number of frames' worth of data; there are 96 bytes of sub-channel data per-frame, and 296 bytes of C2 error info. When BASS_CD_SetOffset has been used to set a read offset, playback may begin mid-frame, and as a result of that, pos may start out negative because the delivered data is from the start of the 1st frame, before where playback will begin from.
Neither sub-channel data or C2 error info will be delivered in the case of a silenced frame resulting from the BASS_CONFIG_CD_SKIPERROR config option being enabled.