Retrieves the pregap length (in bytes) of a track.
Namespace: Un4seen.Bass.AddOn.Cd
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
[DllImportAttribute("basscd")] public static int BASS_CD_GetTrackPregap( int drive, int track )
Parameters
- drive
- Type: SystemInt32
The drive... 0 = the first drive. - track
- Type: SystemInt32
The track to retrieve the pregap length of... 0 = the first track.
Return Value
Type: Int32If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. If successful, the pregap length of the track is returned. To translate the pregap length from bytes to frames, divide by 2352.
Remarks
A track's pregap is actually played as part of the preceeding track. So to remove the gap from the end of a track, you would get the pregap length of the following track. The gap will usually contain silence, but it doesn't have to - it could contain crowd noise in a live recording, for example.
ERROR CODE | Description |
---|---|
BASS_ERROR_DEVICE | drive is invalid. |
BASS_ERROR_NOCD | There's no CD in the drive. |
BASS_ERROR_CDTRACK | The track number is invalid. |
BASS_ERROR_NOTAUDIO | The track is not an audio track. |
BASS_ERROR_NOTAVAIL | Reading sub-channel data is not supported by the drive. |
Examples
// get first track length int len = BassCd.BASS_CD_GetTrackLength(0, 0); // subtract the ending gap len -= BassCd.BASS_CD_GetTrackPregap(0, 1);
See Also