BASS_ChannelSetAttribute

Sets the value of a channel's attribute.

BOOL BASS_ChannelSetAttribute(
    DWORD handle,
    DWORD attrib,
    float value
);

Parameters

handleThe channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD.
attribThe attribute to set the value of... one of the following.
BASS_ATTRIB_BUFFERPlayback buffering length. (HMUSIC/HSTREAM only)
BASS_ATTRIB_FREQSample rate.
BASS_ATTRIB_GRANULEProcessing granularity. (HMUSIC/HSTREAM/HRECORD)
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_NET_RESUMEBuffer level to resume stalled playback. (HSTREAM)
BASS_ATTRIB_NORAMPPlayback ramping.
BASS_ATTRIB_PANPanning/balance position.
BASS_ATTRIB_PUSH_LIMITPush stream buffer limit.
BASS_ATTRIB_SRCSample rate conversion quality.
BASS_ATTRIB_TAILLength extension. (HMUSIC/HSTREAM)
BASS_ATTRIB_VOLVolume level.
BASS_ATTRIB_VOLDSPDSP chain volume level. (HMUSIC/HSTREAM/HRECORD)
BASS_ATTRIB_VOLDSP_PRIORITYDSP chain volume priority. (HMUSIC/HSTREAM/HRECORD)
other attributes may be supported by add-ons, see the documentation.
valueThe new attribute value. See the attribute's documentation for details on the possible values.

Return value

If successful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_ILLTYPEattrib is not valid.
BASS_ERROR_ILLPARAMvalue is not valid. See the attribute's documentation for the valid range of values.
some attributes may have additional error codes, see the documentation.

Remarks

The actual attribute value may not be exactly the same as requested, due to precision differences. For example, an attribute might only allow whole number values. BASS_ChannelGetAttribute can be used to confirm what the value is.

See also

BASS_ChannelFlags, BASS_ChannelGetAttribute, BASS_ChannelSetAttributeEx, BASS_ChannelSet3DAttributes, BASS_ChannelSlideAttribute