Quick answer: pitch_scale resamples — speed and pitch move together. For pitch-only changes, add an AudioEffectPitchShift to the bus.

A rhythm game wants to raise a sound effect’s pitch without speeding it up. Setting pitch_scale = 1.5 makes it both higher and faster — chipmunk effect.

Why pitch_scale Does Both

pitch_scale changes the playback rate. Playing samples faster raises pitch and shortens duration — same as spinning a record faster. That’s resampling, not true pitch shifting.

Use AudioEffectPitchShift

  1. Create a dedicated audio bus (e.g. “SFX_Pitched”).
  2. Add an AudioEffectPitchShift effect to that bus.
  3. Route the AudioStreamPlayer’s bus to it.
  4. Set the effect’s pitch_scale — this is true pitch shift, tempo preserved.
var bus_idx = AudioServer.get_bus_index("SFX_Pitched")
var fx = AudioServer.get_bus_effect(bus_idx, 0) as AudioEffectPitchShift
fx.pitch_scale = 1.5

Quality Trade-Off

Pitch shifting (phase vocoder) is more expensive than resampling and can add artifacts. For extreme shifts, consider pre-rendering pitched variants. For modest shifts (±1 octave), the effect is fine.

Per-Sound vs Bus

The effect is bus-wide. If different sounds need different shifts, use multiple buses or pre-render. Don’t share one bus for sounds needing different pitch.

Verifying

Raise the effect’s pitch_scale. The sound is higher but the same length. Tempo-critical audio (music, rhythm cues) stays in time.

“pitch_scale on the player resamples; AudioEffectPitchShift on the bus shifts pitch only.”

For variety on common SFX (footsteps, hits), a small random pitch_scale resample is actually desirable — the ‘flaw’ is the feature there.