BASS_StreamGetBlockLength

Retrieves the playback length (in bytes) of a block in a file stream (WAV/MP3).

DWORD WINAPI BASS_StreamGetBlockLength(
    HSTREAM handle
);

Parameters
handleThe stream's handle.

Return value
If succesful, then the stream's block length is returned, else NULL is returned. Use BASS_ErrorGetCode to get the error code.

Error codes
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_NOTFILEThe stream is not a file stream... it was not created by using BASS_StreamCreateFile.
BASS_ERROR_POSITIONThe BASS_MP3_SETPOS flag was not specified when calling BASS_StreamCreateFile (MP3 only).

Remarks
When calling BASS_ChannelSetPosition, the position is rounded down to the beginning of a block, so you can use this function to calculate the minimum position increase required to move a stream forward.

Example
To move a stream forward by the smallest possible amount.

DWORD pos=BASS_ChannelGetPosition(a_stream); // get current pos
pos+=BASS_StreamGetBlockLength(a_stream); // add block length
BASS_ChannelSetPosition(a_stream,pos); // set new position

See also
BASS_ChannelSetPosition, BASS_StreamGetLength