BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_ChannelIsActive Method BASS.NET API for the Un4seen BASS Audio Library
Checks if a sample, stream, or MOD music is active (playing) or stalled. Can also check if a recording is in progress.

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

[DllImportAttribute("bass.dll", CharSet = CharSet.Unicode)]
public static BASSActive BASS_ChannelIsActive(
	int handle
)

Parameters

handle
Type: SystemInt32
The channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD.

Return Value

Type: BASSActive
The return value is one of the folowing (see BASSActive):
BASS_ACTIVE_STOPPEDThe channel is not active, or handle is not a valid channel.
BASS_ACTIVE_PLAYINGThe channel is playing (or recording).
BASS_ACTIVE_PAUSEDThe channel is paused.
BASS_ACTIVE_STALLEDPlayback of the stream has been stalled due to there not being enough sample data to continue playing. The playback will automatically resume once there's sufficient data to do so.
Remarks

When using this function with a decoding channel, BASS_ACTIVE_PLAYING will be returned while there is still data to decode. Once the end has been reached, BASS_ACTIVE_STOPPED will be returned. BASS_ACTIVE_STALLED is never returned for decoding channels; you can tell a decoding channel is stalled if BASS_ChannelGetData(Int32, IntPtr, Int32) returns less data than requested, and this function still returns BASS_ACTIVE_PLAYING.

Examples

VB
Dim status As BASSActive = BASS_ChannelIsActive(stream)
If status = BASSActive.BASS_ACTIVE_PLAYING Then
  ' the stream is still playing
  ...
End If
BASSActive status = BASS_ChannelIsActive(stream);
if (status == BASSActive.BASS_ACTIVE_PLAYING)
{
  // the stream is still playing
  ...
}
See Also

Reference