BASS.NET API for the Un4seen BASS Audio Library

BassCdBASS_CD_GetTrackLengthSeconds Method

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the length (in seconds) of a track.

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

public static double BASS_CD_GetTrackLengthSeconds(
	int drive,
	int track
)

Parameters

drive
Type: SystemInt32
The drive... 0 = the first drive.
track
Type: SystemInt32
The track to retrieve the length of... 0 = the first track.

Return Value

Type: Double
If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. If successful, the length of the track in seconds is returned.
Remarks

CD audio is always 44100hz stereo 16-bit. That's 176400 bytes per second.

ERROR CODEDescription
BASS_ERROR_DEVICEdrive is invalid.
BASS_ERROR_NOCDThere's no CD in the drive.
BASS_ERROR_CDTRACKThe track number is invalid.
BASS_ERROR_NOTAUDIOThe track is not an audio track.

See Also

Reference