BASS_CD_GetTrackLength
Retrieves the length (in bytes) of a track.
DWORD BASS_CD_GetTrackLength(
DWORD drive,
DWORD track
);
Parameters
drive | The drive... 0 = the first drive.
|
track | The track to retrieve the length of... 0 = the first track.
|
Return value
If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. If successful, the length of the track is returned.
Error codes
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.
|
Remarks
CD audio is always 44100hz stereo 16-bit. That is 176400 bytes per second. So dividing the track length by 176400 gives the length in seconds.
See also
BASS_CD_GetTrackPregap, BASS_CD_GetTracks