How can I change an Event's pitch as that Event is playing?

At the moment, this is the code I’m using:

inst = AUDIO_SYSTEM->PlaySound("event:/ow", 0.5f); //0.5f being the volume

    if (inst)
    {
      float oldPitch;
      inst->getPitch(&oldPitch);
      oldPitch = oldPitch + 0.02 * dt;
      inst->setPitch(oldPitch);
    }

I’m not sure why the code doesn’t work. When this sound is triggered, it plays the sound unpitched, rather than the pitch increasing over time. Is there a way to change the pitch of the individual sound event on-the-fly, without going through a DSP?

Hi,
That code should work fine. In fact I can do the same change with the 3d.cpp example that comes with the programmers API, in the main loop:

    float pitch;
    ERRCHECK(eventInstance->getPitch(&pitch));
    pitch = pitch + 0.01f;
    ERRCHECK(eventInstance->setPitch(pitch));

By adding that code, the engine pitch increases over time.

You could log the values of pitch that you are setting and check that it is increasing as you expect. Also if you check the return code out of getPitch and setPitch you can make sure there isn’t any problem (such as the event instance handle not being valid).

I haven’t had the chance to check yet, but does this work the same when using FMOD Studio?

Yes, that code is for FMOD Studio.