BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_ChannelGetAttribute Method (Int32, BASSAttribute, Single)BASS.NET API for the Un4seen BASS Audio Library
Retrieves the value of an attribute of a sample, stream or MOD music. Can also get the sample rate of a recording channel.

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

[DllImportAttribute("bass.dll", CharSet = CharSet.Unicode)]
public static bool BASS_ChannelGetAttribute(
	int handle,
	BASSAttribute attrib,
	ref float value
)

Parameters

handle
Type: SystemInt32
The channel handle... a HCHANNEL, HMUSIC, HSTREAM or HRECORD.
attrib
Type: Un4seen.BassBASSAttribute
The attribute to set the value of (one of the following, see BASSAttribute):
BASS_ATTRIB_EAXMIXEAX wet/dry mix.
BASS_ATTRIB_CPUCPU usage. (HMUSIC/HSTREAM)
BASS_ATTRIB_FREQSample rate.
BASS_ATTRIB_MUSIC_ACTIVEActive channel count. (HMUSIC)
BASS_ATTRIB_MUSIC_AMPLIFYAmplification level. (HMUSIC)
BASS_ATTRIB_MUSIC_BPMBPM. (HMUSIC)
BASS_ATTRIB_MUSIC_PANSEPPan separation level. (HMUSIC)
BASS_ATTRIB_MUSIC_PSCALERPosition scaler. (HMUSIC)
BASS_ATTRIB_MUSIC_SPEEDSpeed. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_CHANA channel volume level. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_GLOBALGlobal volume level. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_INSTAn instrument/sample volume level. (HMUSIC)
BASS_ATTRIB_NOBUFFERNon-Windows only: Playback buffering switch. (HMUSIC/HSTREAM)
BASS_ATTRIB_PANPanning/balance position.
BASS_ATTRIB_SRCSample rate conversion quality.
BASS_ATTRIB_VOLVolume level.
Other attributes may be supported by add-ons, e.g. BASS_FX:
BASS_ATTRIB_TEMPOThe tempo of a channel in percent.
BASS_ATTRIB_TEMPO_PITCHThe pitch of a channel in semitones.
BASS_ATTRIB_TEMPO_FREQThe sample rate of a channel in Hz.
BASS_ATTRIB_TEMPO_OPTION_USE_AA_FILTERAA Filter used on a tempo channel.
BASS_ATTRIB_TEMPO_OPTION_AA_FILTER_LENGTHThe AA Filter length in taps.
BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGOTempo quick algorithm used on a tempo channel.
BASS_ATTRIB_TEMPO_OPTION_SEQUENCE_MSThe tempo sequence in ms. used on a tempo channel.
BASS_ATTRIB_TEMPO_OPTION_SEEKWINDOW_MSThe tempo seek window in ms. used on a tempo channel.
BASS_ATTRIB_TEMPO_OPTION_OVERLAP_MSThe tempo overlap in ms. used on a tempo channel.
BASS_ATTRIB_REVERSE_DIRThe current playback direction of a reverse stream.
value
Type: SystemSingle
Pointer to a variable to receive the attribute value.

Return Value

Type: Boolean
If successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_ILLTYPEattrib is not valid.
Some attributes may have additional error codes, see the documentation

Examples

Get the current volume of a channel:
VB
Dim vol As Single = 0F
If Bass.BASS_ChannelGetAttribute(stream, BASSAttribute.BASS_ATTRIB_VOL, vol) Then
  Console.WriteLine("Volume={0}", vol)
End If
float vol = 0f;
if (Bass.BASS_ChannelGetAttribute(stream, BASSAttribute.BASS_ATTRIB_VOL, ref vol))
  Console.WriteLine("Volume={0}", vol);
See Also

Reference