Is it possible to change the pitch of an audio at runtime?

Hi.

Currently I am using the AudioEngine to play audio and I would like to change the pitch of the audio currently playing at runtime but it doesn’t seems to be possible.
On the forum somebody was suggesting an fmod extension for Cocos2D-x:
https://github.com/semgilo/cocos2d-x-fmod

Obviously this extension is not meant to be used with Cocos Creator though one person in the topic mentioned he/she managed to bring this fmod extension in to Cocos Creator but did not share how he/she did it.
is there any other solutions out there I could try? preferably one that could work with both web and native builds?

If currently there is not, is something coming in future version of Cocos Creator?
I’ve seen people talking about v2.4.3 and Cocos Creator 3 coming (maybe it is the same version). Is any of those versions going to include a feature to change the pitch?
It would be useful to avoid including multiple audio files of the same sound only with different pitch.

Thank you.

On web, you can change the pitch by calling the standard WebAudio API. On the native, maybe you can use FMOD to do that.

1 Like