Retrieves the pregap length (in bytes) of a track.
DWORD BASS_CD_GetTrackPregap( DWORD drive, DWORD track );
|drive||The drive... 0 = the first drive.|
|track||The track to retrieve the pregap length of... 0 = the first track.|
|BASS_ERROR_DEVICE||drive is invalid.|
|BASS_ERROR_NOCD||There is 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.|
A track's pregap is actually played as part of the preceding 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 does not have to; it could contain crowd noise in a live recording, for example.
DWORD len=BASS_CD_GetTrackLength(0, 0); // get first track length len-=BASS_CD_GetTrackPregap(0, 1); // subtract the ending gap