Skip to content

Doppler effect calculation only takes AudioStreamPlayer3D velocity into account, not AudioListener3D #107799

@RoyBerardo

Description

@RoyBerardo

Tested versions

Found in 4.5
Happens in 4.4

System information

Windows 10

Issue description

When calculating doppler effect pitch, only the velocity of the AudioStreamPlayer3D is taken into account, even though both players and listeners should have their velocities used for the calculation. Because of this, if doppler is desired on stationary objects while the listener zooms by, such as in a racing/flight game, no doppler effect will be heard. In addition, if a doppler-enabled AudioStreamPlayer3D is moving with the current AudioListener3D at the same velocity, the pitch will be affected even though there should be no change. The one exception to this last case is when the emitter and listener move perpendicularly to how they are arranged, in which case no doppler effect is heard.

Here is a video of the minimal reproduction project in action (sound on):

2025-06-21.04-29-25.mp4

Steps to reproduce

  1. Download and play the reproduction project (4.4)
  2. Click "Static Listener, Moving Player". Observe how the doppler effect works correct here.
  3. Click "Moving Listener, Static Player". Observe how the doppler effect now does nothing.
  4. Click "Both Moving (on axis)". Observe how the doppler effect is occuring even though it should not be.
  5. Click "Both Moving (perpendicular)". Observe how there is now no noticeable doppler effect.

Minimal reproduction project (MRP)

doppler_mrp.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions