2

I'm having problems to shfit ptich with fmod. I can do it with channel::setfrequency but I need to use it on larger sfx and thus need accuracy [no tempo changes] with DSP. However I seem to can't apply the filter.

FMOD::DSP* dsp;
result = m_soundSystem->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsp);      
dsp->setParameter(0, 2.0f);
result = m_soundChannels[i]->addDSP(dsp, 0);

nothing's happening there. this code is in my custom play function and is executed right before I play sound (I load with pause on true and then do the changes). Both functions dont throw any error into result variable. What's wrong then? :S

user1255410
  • 856
  • 1
  • 9
  • 15

2 Answers2

1

Try this:

FMOD::DSP* dsp;
result = m_soundSystem->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsp);
result = m_soundChannels[i]->addDSP(dsp, 0);
dsp->setParameter(FMOD_DSP_PITCHSHIFT_PITCH, 2.0f);
eugen
  • 85
  • 2
  • 6
0

You mention the above code is executed right before you play the sound. You must call Channel::addDSP after System::playSound or the FMOD::Channel will not be valid yet.

Mathew Block
  • 1,613
  • 1
  • 10
  • 9