Skip to content

Fix AudioListener3D not tracking velocity for doppler #108051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RoyBerardo
Copy link
Contributor

This closes #107799

It seems that AudioListener3D did not have any code for using its own velocity for doppler calculation, so I essentially just copied over the Camera3D doppler code. Didn't need to change much at all, the code for the camera doppler calculation does everything it needs to do and nothing more.

Now, doppler works as expected when the listener moves.

This will have a noticeable but also likely preferable change in sound for projects which use doppler and a moving listener.

@RoyBerardo RoyBerardo requested review from a team as code owners June 27, 2025 17:06
@Calinou Calinou added this to the 4.5 milestone Jun 27, 2025
@Calinou Calinou added the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Jun 27, 2025
@RoyBerardo
Copy link
Contributor Author

Had a realization of something, tested to confirm that it does happen. If doppler tracking is disabled on the listener but enabled on a stream player, doppler will still be heard. I'm on the fence on if this is a bug or not, since the doppler setting enables tracking, not doppler itself. If this IS a bug, should I tackle that in this PR as well? To add, the camera currently exhibits this behavior, so fixing this bug would fix it for both listeners and cameras.

@Mickeon Mickeon requested a review from a team June 28, 2025 09:32
@akien-mga akien-mga changed the title fix AudioListener3D not tracking velocity for doppler Fix AudioListener3D not tracking velocity for doppler Jun 28, 2025
@RoyBerardo RoyBerardo marked this pull request as draft July 7, 2025 07:04
@RoyBerardo
Copy link
Contributor Author

Had a realization of something, tested to confirm that it does happen. If doppler tracking is disabled on the listener but enabled on a stream player, doppler will still be heard. I'm on the fence on if this is a bug or not, since the doppler setting enables tracking, not doppler itself. If this IS a bug, should I tackle that in this PR as well? To add, the camera currently exhibits this behavior, so fixing this bug would fix it for both listeners and cameras.

I've decided to convert this PR to a draft for now, since I feel this is an important topic to address. It's a very easy fix that can be done in this PR, but I wonder what the best approach would be.

IMO, doppler should only be heard on a sound if both the emitter and listener have doppler enabled. That being said, this would require projects that use doppler and the camera as a listener to enable doppler on the camera, if they haven't already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release topic:audio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doppler effect calculation only takes AudioStreamPlayer3D velocity into account, not AudioListener3D
2 participants