Animation Player doesn't stop playing in Browser

Godot Version

Godot 4.3

Question

I have all my sound effects handled by the animation player, namely to help sync it up with dialogue, make it easy to reference sounds for characters, etc. However, when I call animation_player.stop(), it works just fine when exporting to most platforms, but when exporting to HTML it often ignores the stop command, continuing to play the sounds.

This means, for example, I have a cutscene playing the sound of typing on a keyboard, but you can skip the cutscene, which calls animation_player.stop(). This means in the windows and linux exports, you skip the cutscene, the sounds stop playing, and you continue normally, but in browser, you skip the cutscene and it’s still playing keyboard typing sounds well after, even when animation_player.stop() is called multiple times after.

1 Like

I don’t think the problem is actually in the animation player. The problem is godot defaults the playback type for web exports to sample. Try going into Project settings/audio/general and changing defaul playback type.web to stream. That should fix your issue. If you dont see the option its under advanced settings.

1 Like