AUDIO • ACOUSTIC TUNING
Unity Audio Pitch Too Fast or Chipmunk Sound Effect
Fix engine audio screeching or accelerating into ultra high frequencies when car or aircraft speeds increase.
The Math Solution: Normalized Lerp & Clamp
Never assign raw speed directly into pitch (e.g. pitch = speed * 0.1f). Instead, normalize speed against your vehicle's max speed with Mathf.Clamp01(), and interpolate between safe acoustic limits (e.g. 0.6f idle to 2.0f redline).
1
Clamped Pitch Calculation Script
SafeEnginePitch.cs (C#)
using UnityEngine;
public class SafeEnginePitch : MonoBehaviour
{
[SerializeField] private AudioSource engineSource;
[SerializeField] private Rigidbody carRb;
[SerializeField] private float topSpeed = 45f; // m/s (162 km/h)
private const float MIN_PITCH = 0.65f;
private const float MAX_PITCH = 1.95f; // Hard ceiling prevents chipmunk distortion
private void Update()
{
if (engineSource == null || carRb == null) return;
// 1. Calculate normalized ratio between 0.0 and 1.0
float speedRatio = Mathf.Clamp01(carRb.linearVelocity.magnitude / topSpeed);
// 2. Interpolate safely
float targetPitch = Mathf.Lerp(MIN_PITCH, MAX_PITCH, speedRatio);
// 3. Smooth with delta time
engineSource.pitch = Mathf.MoveTowards(engineSource.pitch, targetPitch, 2.5f * Time.deltaTime);
}
}