BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_ChannelSlideAttribute Method BASS.NET API for the Un4seen BASS Audio Library
Slides a channel's attribute from its current value to a new value.

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_ChannelSlideAttribute(
	int handle,
	BASSAttribute attrib,
	float value,
	int time
)

Parameters

handle
Type: SystemInt32
The channel handle... a HCHANNEL, HSTREAM or HMUSIC, or HRECORD.
attrib
Type: Un4seen.BassBASSAttribute
The attribute to slide the value of (one of the following, see BASSAttribute):
BASS_ATTRIB_FREQSample rate.
BASS_ATTRIB_PANPanning/balance position.
BASS_ATTRIB_VOLVolume level.
BASS_ATTRIB_EAXMIXEAX wet/dry mix.
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)
Other attributes may be supported by add-ons, see the documentation
value
Type: SystemSingle
The new attribute value. See the attribute's documentation for details on the possible values.
time
Type: SystemInt32
The length of time (in milliseconds) that it should take for the attribute to reach the value.

Return Value

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

This function is similar to BASS_ChannelSetAttribute(Int32, BASSAttribute, Single), except that the attribute is ramped to the value over the specified period of time. Another difference is that the value is not pre-checked. If it is invalid, the slide will simply end early.

If an attribute is already sliding, then the old slide is stopped and replaced by the new one.

BASS_ChannelIsSliding(Int32, BASSAttribute) can be used to check if an attribute is currently sliding. A BASS_SYNC_SLIDE sync can also be set via BASS_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr), to be triggered at the end of a slide. The sync will not be triggered in the case of an existing slide being replaced by a new one.

Attribute slides are unaffected by whether the channel is playing, paused or stopped. They carry on regardless.

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

Fadeout a channel's volume over a period of 1 second:
VB
Bass.BASS_ChannelSlideAttribute(channel, BASSAttribute.BASS_ATTRIB_VOL, 0F, 1000)
Bass.BASS_ChannelSlideAttribute(channel, BASSAttribute.BASS_ATTRIB_VOL, 0f, 1000);
See Also

Reference