Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Audio Why is audio source pitch clamped to 3?

Discussion in 'Audio & Video' started by ArachnidAnimal, Sep 10, 2019.

  1. ArachnidAnimal


    Mar 3, 2015
    I'm using some third part vehicle assets that adjust the adjust the audio source pitch based on RPM. Unity clamps the audio source pitch to 3, it cannot go any higher.
    Does anyone know why this is? Is this some limitation of audio engine?
    I need the pitch to go higher to sound more realistic.
  2. Hikiko66


    May 5, 2013
    You can go higher than a pitch of 3 via script.

    Code (csharp):
    1. audioSource.pitch = 7.0f
    That code works.

    It's the editor GUI slider for the pitch that restricts the pitch between -3 and 3
    That can be seen here:
    Code (csharp):
    1. EditorGUILayout.Slider(m_Pitch, -3.0f, 3.0f, Styles.pitchLabel);
    This wouldn't matter though, the asset is setting the pitch via script, not via the audiosource GUI. Perhaps it has these pitch range settings as public variables available in the inspector somewhere so that you can change them. If those public variables are also restricted to -3 / 3, or they are private variables, you can dig into the script and change the values of the range.

    Search the scripts for the words Pitch/Min/Max
    It probably has them for each gear
    ArachnidAnimal likes this.