BASS.NET API for the Un4seen BASS Audio Library

BassBASS_ChannelGetPosition Method (Int32, BASSMode)

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the playback position of a sample, stream, or MOD music. Can also be used with a recording channel.

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

[DllImportAttribute("bass")]
public static long BASS_ChannelGetPosition(
	int handle,
	BASSMode mode
)

Parameters

handle
Type: SystemInt32
The channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD.
mode
Type: Un4seen.BassBASSMode
How to retrieve the position. One of the following (see BASSMode):
BASS_POS_BYTEGet the position in bytes.
BASS_POS_MUSIC_ORDERGet the position in orders and rows... LoWord = order, HiWord = row * scaler (BASS_ATTRIB_MUSIC_PSCALER). (HMUSIC only).
BASS_POS_DECODEFlag: Get the decoding/rendering position, which may be ahead of the playback position due to buffering. This flag is unnecessary with decoding channels because the decoding position will always be given for them anyway, as they do not have playback buffers.
Other modes may be supported by add-ons, see the documentation.

Return Value

Type: Int64
If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. If successful, the position is returned.
Remarks

With MOD music you might use the LowWord32(Int32) and HighWord32(Int32) methods to retrieve the order resp. the row values.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_NOTAVAILThe requested position is not available.
BASS_ERROR_UNKNOWNSome other mystery problem!

Examples

long pos = Bass.BASS_ChannelGetPosition(stream, BASSMode.BASS_POS_BYTE);
See Also

Reference