BASS_ChannelGetAttributeEx

Retrieves the value of a channel's attribute.

DWORD BASS_ChannelGetAttributeEx(
    DWORD handle,
    DWORD attrib,
    void *value,
    DWORD typesize
);

Parameters

handleThe channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD.
attribThe attribute to get the value of. One of the following.
BASS_ATTRIB_BITRATEAverage bitrate.
BASS_ATTRIB_BUFFERPlayback buffering length.
BASS_ATTRIB_CPUCPU usage.
BASS_ATTRIB_DOWNLOADPROCInternet stream download callback.
BASS_ATTRIB_DOWNMIXPlayback downmixing.
BASS_ATTRIB_FREQSample rate.
BASS_ATTRIB_GRANULEProcessing granularity.
BASS_ATTRIB_MUSIC_ACTIVEMOD music active channel count.
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 a buffer to receive the attribute data.
typesizeThe type/size of the attribute. This can be one of the following types, or the maximum size in bytes if the type is undefined. 0 = get the type/size of the attribute without getting the data.
BASS_ATTRIBTYPE_FLOAT32-bit floating-point.
BASS_ATTRIBTYPE_INT32-bit integer.

Return value

If successful, the type/size of the attribute data is returned, else 0 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_ILLPARAMtypesize is not valid.
some attributes may have additional error codes, see the documentation.

Remarks

Natively floating-point attributes can be retrieved as integers and vice versa, but there may be some loss of precision in doing so.

See also

BASS_ChannelGetAttribute, BASS_ChannelGetInfo, BASS_ChannelSetAttributeEx