BASS.NET API for the Un4seen BASS Audio LibraryBassMixBASS_Mixer_ChannelGetEnvelopePos Method (Int32, BASSMIXEnvelope, Single)BASS.NET API for the Un4seen BASS Audio Library
Retrieves the current position and value of an envelope on a channel.

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

[DllImportAttribute("bassmix.dll", CharSet = CharSet.Unicode)]
public static long BASS_Mixer_ChannelGetEnvelopePos(
	int handle,
	BASSMIXEnvelope type,
	ref float value
)

Parameters

handle
Type: SystemInt32
The mixer source channel handle (which was add via BASS_Mixer_StreamAddChannel(Int32, Int32, BASSFlag) or BASS_Mixer_StreamAddChannelEx(Int32, Int32, BASSFlag, Int64, Int64)) beforehand).
type
Type: Un4seen.Bass.AddOn.MixBASSMIXEnvelope
The envelope to get the position/value of. One of the following (see BASSMIXEnvelope):
BASS_MIXER_ENV_FREQSample rate.
BASS_MIXER_ENV_VOLVolume.
BASS_MIXER_ENV_PANPanning/balance.
value
Type: SystemSingle
A reference to a variable to receive the envelope value at the current position.

Return Value

Type: Int64
If successful, the current position of the envelope is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

The envelope's current position is not necessarily what is currently being heard, due to buffering.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not plugged into a mixer.
BASS_ERROR_ILLTYPEtype is not valid.
BASS_ERROR_NOTAVAILThere is no envelope of the requested type on the channel.

Examples

VB
Dim val As Single = 0F
Dim pos As Integer = BassMix.BASS_Mixer_ChannelGetEnvelope(source, 
                             BASSMIXEnvelope.BASS_MIXER_ENV_VOL, val)
Console.WriteLine("Pos={0}, Val={1}", pos, val)
float val = 0f;
int pos = BassMix.BASS_Mixer_ChannelGetEnvelope(source, 
                  BASSMIXEnvelope.BASS_MIXER_ENV_VOL, ref val);
Console.WriteLine("Pos={0}, Val={1}", pos, val);
See Also

Reference