BASS.NET API for the Un4seen BASS Audio Library

CDDATAPROC Delegate

BASS.NET API for the Un4seen BASS Audio Library

Namespace:  Un4seen.Bass.AddOn.Cd
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

public delegate void CDDATAPROC(
	int handle,
	int pos,
	BASSCDDATAType type,
	IntPtr buffer,
	int length,
	IntPtr user
)

Parameters

handle
Type: SystemInt32
The CD stream that provided the data.
pos
Type: SystemInt32
The stream position (in bytes) that the data is from.
type
Type: Un4seen.Bass.AddOn.CdBASSCDDATAType
The type of data, which can be one of the following (see BASSCDDATAType):

BASS_CD_DATA_SUBCHANNEL : Sub-channel data.

BASS_CD_DATA_C2 : C2 error info.

buffer
Type: SystemIntPtr
The pointer to the buffer data.
length
Type: SystemInt32
The amount of data in bytes.
user
Type: SystemIntPtr
The user instance data given when BASS_CD_StreamCreateEx(Int32, Int32, BASSFlag, CDDATAPROC, IntPtr) or BASS_CD_StreamCreateFileEx(String, BASSFlag, CDDATAPROC, IntPtr) was called.
Remarks

Sub-channel data or C2 error info is delivered to this function as soon as it is read from the CD, before the associated audio data is played, or delivered by BASS_ChannelGetData(Int32, IntPtr, Int32) in the case of a decoding channel. The pos value can be used to synchronize the delivered data with the stream's audio data.

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(Int32, Int32) 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.

See Also

Reference