godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.48k stars 21.26k forks source link

Attenuation model of AudioStreamPlayer3D breaks when using AnimationPlayer with web build #98924

Open nick-loginov opened 3 weeks ago

nick-loginov commented 3 weeks ago

Tested versions

System information

Windows 10 - v4.3.stable.official [77dcf97d8]

Issue description

Attenuation model emits sound globally with max_distance setting only on the web build

Steps to reproduce

1) Create AudioStreamPlayer3D, AnimationPlayer 2) Add Audio Playback track to animation and play animation with AnimationPlayer 3) Configure moving camera to check if max_distance and attenuation model works properly 4) Build for web, sound is emitted globally for some reason.

Compare Web build to debug play, you will see that's only web build issue

Minimal reproduction project (MRP)

TestAudioStream3D.zip

Calinou commented 3 weeks ago

As a workaround, change the AudioStreamPlayer3D's playback mode to Stream. This comes at the cost of increased latency though, especially when threads are disabled.