Retrieves the playback length (in bytes) of a file stream (WAV/MP3).
DWORD WINAPI BASS_StreamGetLength( |
Parameters
handle | The stream's handle. |
Return value
If succesful, then the stream's length is returned, else NULL is returned. Use BASS_ErrorGetCode to get the error code.
Error codes
BASS_ERROR_HANDLE | handle is not valid. |
BASS_ERROR_NOTFILE | The stream is not a file stream... it was not created by using BASS_StreamCreateFile. |
Remarks
It's not always possible to 100% accurately estimate the length of a stream, so the length returned may be only an approximation when using some WAV codecs. The length is always accurate for MP3s when the BASS_MP3_SETPOS flag is used with BASS_StreamCreateFile. When the BASS_MP3_SETPOS flag is not used, the length is an estimation based on the file size.
Example
To get the duration (in seconds) of a file stream.
DWORD len,freq,flags,time; |