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.
BASS_ATTRIB_DOWNMIXPlayback downmixing.
BASS_ATTRIB_FREQSample rate.
BASS_ATTRIB_GRANULEProcessing granularity.
BASS_ATTRIB_MUSIC_AMPLIFYMOD music amplification level.
BASS_ATTRIB_MUSIC_BPMMOD music BPM.
BASS_ATTRIB_MUSIC_PANSEPMOD music pan separation level.
BASS_ATTRIB_MUSIC_PSCALERMOD music position scaler.
BASS_ATTRIB_MUSIC_SPEEDMOD music speed.
BASS_ATTRIB_MUSIC_VOL_CHANMOD music channel volume level.
BASS_ATTRIB_MUSIC_VOL_GLOBALMOD music global volume level.
BASS_ATTRIB_MUSIC_VOL_INSTMOD music instrument/sample volume level.
BASS_ATTRIB_NET_RESUMEDownload buffer level to resume stalled playback.
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.
BASS_ATTRIB_VOLVolume level.
BASS_ATTRIB_VOLDSPDSP chain volume level.
BASS_ATTRIB_VOLDSP_PRIORITYDSP chain volume priority.
Other attributes may be supported by add-ons.
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_ILLTYPEThe channel does not have the requested attribute.
BASS_ERROR_ILLPARAMvalue is not valid.
BASS_ERROR_DENIEDThe attribute is read-only.
some attributes may have additional error codes, see the documentation.

Remarks

When setting an integer attribute, the floating-point value will be truncated (fractional part removed) and capped to integer range, but values exceeding +/-16777216 may be imprecise. BASS_ChannelSetAttributeEx can be used instead to set such large values precisely.

If the attribute is currently sliding from a BASS_ChannelSlideAttribute call then that will be stopped before applying the new value. BASS_SYNC_SLIDE syncs will be triggered by this.

See also

BASS_ChannelFlags, BASS_ChannelGetAttribute, BASS_ChannelSetAttributeEx, BASS_ChannelSet3DAttributes, BASS_ChannelSlideAttribute