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?
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).