godotengine / godotengine/godot

Audio freeze on web build when it plays for the first time

Open
#115,331 5 comments 0 reactions 0 assignees View on GitHub
bug platform:web topic:audio topic:platforms
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in : 4.5.1

### System information

-Browser: Chrome -OS: Windows -CPU: AMD Ryzen 5 3600XT -GPU: NVIDIA Gefore RTX 2070 -RAM: 16GB

### Issue description

When audio plays for the first time on a web build, there's a little freeze happening before the game catch up. It happens everytime some audio plays for the first time, the longer the file, the longer the freeze. Having a file being a .wav helps out but there's still a tiny freeze.

I would expect for it to not freeze

Here's a tiny video on how it looks on my end:

https://github.com/user-attachments/assets/2a2ccc42-d61e-4b58-821d-e5bb57cd6b7f

### Steps to reproduce

**If you want to do it yourself:**
- Create a project
- Have the godot icon do a simple animation (like rotating on itself) through a script or an animator
- Have an audio stream with an animator as a child
- After a small delay play a long .ogg file through the audio stream
- Make an export preset for an html build
- Remote deploy the game
- Once the .ogg start playing, notice the freeze

**If you want to do it through the MRP:**
Just remote deploy and you'll notice a freeze once the really bad self made song starts

You can also just go on the web link

### Minimal reproduction project (MRP)

[AudioWebFreeze.zip](https://github.com/user-attachments/files/24837060/AudioWebFreeze.zip)

You can also check an already done build through [this link](https://binarygleam.itch.io/audiowebfreezegodotfourpointfivepointone)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.