BASS_ATTRIB_TEMPO

BASS FX

BASS_ATTRIB_TEMPO attribute

Set tempo of a channel.

BOOL BASS_ChannelSetAttribute(
    DWORD handle,
    BASS_ATTRIB_TEMPO,
    float tempo
);

Parameters

handle Tempo stream (or source channel) handle
tempo Tempo value [-95%..0..+5000%] percents

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

Error codes

BASS_ERROR_HANDLE handle  is invalid
BASS_ERROR_ILLPARAM An illegal parameter was specified

Info
Tempo (time-stretch): Changes the sound to play at faster or slower speed than original, without affecting the sound pitch.

Example
Set Tempo by BPM value:

float tempo = (goalBPM / bpmValue - 1.0f) * 100.0f;
BASS_ChannelSetAttribute(chan, BASS_ATTRIB_TEMPO, tempo);


See also
BASS_FX_TempoCreate, BASS_FX_TempoGetSourceBASS_FX_TempoGetRateRatio