Open ngreve opened 4 years ago
I think this was intentional. The current doppler tracking code cuts out after shifting the sound three octaves. The tricky part is that at some point you have to do more than just pitch shift to accurately portray doppler shift. The easiest way to conceptualize this to think about how a sonic boom is more than just a pitch shift. As a workaround you can try and do that acoustic modeling yourself and adjust pitch_scale
. It seems tricky though.
Should the doppler effect be clamped to 3 octaves instead of being cut abruptly? If not, I guess we should just document this in the class reference.
It is currently clamped, yeah. It's just hard to justify getting much closer to the speed of sound without actually doing the math to determine what it sounds like at that speed. https://github.com/godotengine/godot/blob/43cc6dd4798a348f35da5e404d4b2cd8ff8a9042/scene/3d/audio_stream_player_3d.cpp#L489
Godot version: v3.2.2.beta.custom_build.c7ad8f539
OS/device including version: Linux
Issue description: When using the Doppler effect on an AudioStreamPlayer3D the audio gets cut off, when the object its used on reaches a certain speed.
This video shows a cube accelerating towards the camera, while playing a rocket engine sound. At the ~3rd second the Doppler effect stops abruptly. doppler_audio_bug.zip
Steps to reproduce:
Minimal reproduction project: doppler_audio_bug.zip