BASS.NET API for the Un4seen BASS Audio LibraryBassEncBASS_Encode_IsActive Method BASS.NET API for the Un4seen BASS Audio Library
Checks if an encoder is running on a channel.

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

[DllImportAttribute("bassenc.dll", CharSet = CharSet.Auto)]
public static BASSActive BASS_Encode_IsActive(
	int handle
)

Parameters

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

Return Value

Type: BASSActive
The return value is one of the folowing (see BASSActive):
BASS_ACTIVE_STOPPEDNo encoder is running on the channel.
BASS_ACTIVE_PLAYINGThere is an encoder running on the channel.
BASS_ACTIVE_PAUSEDThere is an encoder running on the channel, but it is paused.
Remarks

When checking if there's an encoder running on a channel, and there are multiple encoders on the channel, BASS_ACTIVE_PLAYING will be returned if any of them are active.

If an encoder stops running prematurely, BASS_Encode_Stop(Int32) should still be called to release resources that were allocated for the encoding.

Examples

In a recording callback (see RECORDPROC) this might be used to check, if recording should be continued:
VB
Private Function RecordingCallback(channel As Integer, buffer As IntPtr, 
                                   length As Integer, user As IntPtr) As Boolean
  ' continue recording if encoder is alive
  Return BassEnc.BASS_Encode_IsActive(channel) <> BASSActive.BASS_ACTIVE_STOPPED
End Function
private bool RecordingCallback(int channel, IntPtr buffer, int length, IntPtr user)
{
  // continue recording if encoder is alive
  return ( BassEnc.BASS_Encode_IsActive(channel) != BASSActive.BASS_ACTIVE_STOPPED );
}
See Also

Reference