BASS_ChannelSetAttributeEx

Sets the value of a channel's attribute.

BOOL BASS_ChannelSetAttributeEx(
    DWORD handle,
    DWORD attrib,
    void *value,
    DWORD typesize
);

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_DOWNLOADPROCInternet stream download callback.
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_SCANINFOScanned info.
BASS_ATTRIB_SRCSample rate conversion quality.
BASS_ATTRIB_TAILLength extension.
BASS_ATTRIB_USERUser-defined info.
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.
valuePointer to the new attribute data.
typesizeThe type/size of the attribute data. This can be one of the following types, or the size in bytes if the type is undefined.
BASS_ATTRIBTYPE_FLOAT32-bit floating-point.
BASS_ATTRIBTYPE_INT32-bit integer.

Return value

If successful, 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 or typesize is not valid.
BASS_ERROR_DENIEDThe attribute is read-only.
some attributes may have additional error codes, see the documentation.

Remarks

Natively floating-point attributes can be set as integers and vice versa. A floating-point value (typesize=BASS_ATTRIBTYPE_FLOAT) used to set an integer attribute will be truncated (fractional part removed) and capped to integer range.

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.

Example

Set a channel's DSP chain volume priority to 20.
int priority = 20;
BASS_ChannelSetAttributeEx(handle, BASS_ATTRIB_VOLDSP_PRIORITY, &priority, BASS_ATTRIBTYPE_INT);

See also

BASS_ChannelGetAttributeEx, BASS_ChannelSetAttribute