You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An AudioStreamPlayer with playing=true in a AnimationPlayer animation plays back incorrectly when the animation is played from a StateMachine inside an AnimationTree. It sounds like it may be a buzz of the first milliseconds on repeat.
Using a different audio file, or encoding as OGG vs WAV
Setting the animation track, AudioStream and/or the AudioStreamPlayer to loop
Changing the AudioStreamPlayer to AudioStreamPlayer3D
Changing the StateMachine transitions
Whether the AnimationTree is set to deterministic
Adding the AudioStreamPlayer's track to all animations
Note: This project incidentally triggers the spurious _transition_to_next_recursive error from #82935, so I also tested with #89575, and can confirm that PR fixes the error (and, as expected, reproduces this bug).
Steps to reproduce
Create an AudioStreamPlayer and assign an AudioStream. Note that it plays back correctly in the Inspector.
Create an AnimationPlayer. Create a new animation, add a track for the AudioStreamPlayer's playing property and set it to true. Note that it plays back correctly when the animation is played.
Create an AnimationTree. Set the Anim Player path to the AnimationPlayer. Create a StateMachine node. Add the animation with the audio track to the state machine. Note that it plays back incorrectly when the StateMachine node is played.
Setting CallbackModeDiscrete to Dominant will provide the expected behavior.
However, this will still cause the audio to be interrupted by changing the stream to play when the state is changed. This is the intended behavior for ValueTrack. So, it is recommended to use AudioTrack for audio playback in the first place. AudioTrack has a Don't Use Blend property for that use cases where the playback stream exceeds the animation length.
Tested versions
System information
Godot v4.3.dev4 - Windows 10.0.22621 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3080 Laptop GPU (NVIDIA; 31.0.15.4633) - 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 Threads)
Issue description
An AudioStreamPlayer with
playing=true
in a AnimationPlayer animation plays back incorrectly when the animation is played from a StateMachine inside an AnimationTree. It sounds like it may be a buzz of the first milliseconds on repeat.Videos of the MRP (audio from Kenney's Music Jingles):
godot-4-3-dev3.mp4
godot-4-3-dev4.mp4
Things that don't change the outcome:
deterministic
Note: This project incidentally triggers the spurious
_transition_to_next_recursive
error from #82935, so I also tested with #89575, and can confirm that PR fixes the error (and, as expected, reproduces this bug).Steps to reproduce
playing
property and set it to true. Note that it plays back correctly when the animation is played.Anim Player
path to the AnimationPlayer. Create a StateMachine node. Add the animation with the audio track to the state machine. Note that it plays back incorrectly when the StateMachine node is played.Minimal reproduction project (MRP)
state-machine-audio.zip
The text was updated successfully, but these errors were encountered: