Change speed sound Fmod in Unity runtime.


(trung) #1

Hello! I create FMOD.Sound by using AudioClip in Unity. How I can change speed of this sound in runtime. I tried to use setMusicSpeed but it’s not effective.


(リチャード清水) #2

Hi Trung,

You can use setPitch() on the FMOD::Channel that the FMOD::Sound is using. You should have this Channel already when creating the FMOD::Sound.

https://www.fmod.com/resources/documentation-api?page=content/generated/FMOD_Channel_SetPitch.html#/

Thanks,
Richard


(trung) #3

Thanks Richard,
I tried this solution but this make sound got deformation. Has any solution didn’t make sound deformation?


(リチャード清水) #4

Hi Trung,

If you are looking for a method of increasing the playback rate without affecting the pitch then we unfortunately do not support this.

You can use the Pitch Shifter DSP to compensate the changes in pitch however this method is very expensive on resources and may not sound the best quality.

Thanks,
Richard