void MusicPlayer::multSpeedSpecific(int index, float speed){
speeds[index] = speeds[index] * speed;
FMOD_DSP_SetParameterFloat(dsp, 0, 1/speeds[index]);
FMOD_Channel_SetPitch(channel[index], speeds[index]);
FMOD_Channel_AddDSP(channel[index], 0, dsp);
}
This is a function that I’m using. When I call that function when the music is playing, the music is stopped for a short time. Is it natural? Can I remove the blinking of music?
[ EDIT ]
I tested it with a simple code snippet.
include “fmod.h”
include “fmod_common.h”
include “fmod_errors.h”
include <unistd.h>
int main(int argc, char argv[])
{
FMOD_SYSTEM system;
FMOD_SOUND sound;
FMOD_CHANNEL channel;
FMOD_DSP* dsp;
FMOD_System_Create(&system);
FMOD_System_Init(system, 320, FMOD_INIT_NORMAL, nullptr);
FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_PITCHSHIFT, &dsp);
FMOD_System_CreateSound(system, “C:/Users/Aaron/Desktop/Central park.mp3”, FMOD_LOOP_OFF | FMOD_2D, nullptr, &sound);
FMOD_System_PlaySound(system, sound, nullptr, false, &channel);
sleep(1);
FMOD_Channel_SetPaused(channel, true);
FMOD_Channel_SetPitch(channel, 1.1f);
FMOD_DSP_SetParameterFloat(dsp, 0, 1/1.1f);
FMOD_Channel_AddDSP(channel, 0, dsp);
FMOD_Channel_SetPaused(channel, false);
sleep(1);
FMOD_Channel_SetPaused(channel, true);
FMOD_Channel_SetPitch(channel, 1.2f);
FMOD_DSP_SetParameterFloat(dsp, 0, 1/1.2f);
FMOD_Channel_AddDSP(channel, 0, dsp);
FMOD_Channel_SetPaused(channel, false);
sleep(1);
FMOD_Channel_SetPaused(channel, true);
FMOD_Channel_SetPitch(channel, 1.3f);
FMOD_DSP_SetParameterFloat(dsp, 0, 1/1.3f);
FMOD_Channel_AddDSP(channel, 0, dsp);
FMOD_Channel_SetPaused(channel, false);
}
And I found that short stop occurs in FMOD_Channel_AddDSP function.
How can I handle this?