I’m playing back sounds with a simple pitch-shifted sample playback, however after a few seconds of adding more samples, the audio starts to “clip.” Any advice on how to avoid this? These are 2 second WAV samples. The code worked in much earlier versions of FMOD. I’m on iOS.
ERRCHECK(fmodsys_->playSound(sound, 0, true, &channel));
fmodresult_ = channel->setVolume(kVolume);
ERRCHECK(channel->getFrequency(&channelFrequency));
ERRCHECK(channel->setFrequency(powf(2.0f,pitchShift/12.0f) * channelFrequency));
ERRCHECK(channel->setPaused(false)); // This is where the sound really starts
Here’s a video example:
And here’s how I load the sounds:
FMOD::System_Create(&fmodsys_);
fmodresult_ = fmodsys_->init(32, FMOD_INIT_NORMAL, NULL);
ERRCHECK(fmodresult_);
SetFMODSystem(fmodsys_);
fmodsys_ = GetFMODSystem();
fmodresult_ = fmodsys_->createSound(buffer, FMOD_CREATESAMPLE, NULL, &sound);
ERRCHECK(fmodresult_);
Thanks!