BASS_ATTRIB_FREQ attribute

The sample rate of a channel.

BASS_ChannelSetAttribute(
    DWORD handle,
    BASS_ATTRIB_FREQ,
    float freq
);

Parameters

handleThe channel handle.
freqThe sample rate... 0 = original rate (when the channel was created).

Remarks

This attribute is applied during playback of the channel and is not present in the sample data returned by BASS_ChannelGetData, so it has no direct effect on decoding channels.

Increasing the sample rate of a stream or MOD music increases its CPU usage, and reduces the length of its playback buffer in terms of time. If you intend to raise the sample rate above the original rate then you may also need to increase the buffer length via the BASS_CONFIG_BUFFER config option to avoid breaks in the sound.

When using BASS_ChannelSlideAttribute to slide this attribute, the BASS_SLIDE_LOG flag can be used to make a slide logarithmic rather than linear.

See also

BASS_ChannelGetAttribute, BASS_ChannelSetAttribute, BASS_ChannelSlideAttribute, BASS_GetInfo