godotengine / godotengine/godot
[Web] `DisplayServer.tts_get_voices` returns an empty array on the first load
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in: 4.4.beta3
### System information
Godot v4.4.beta3 - Ubuntu 24.04.2 LTS 24.04 on X11 - X11 display driver, Multi-window, 1 monitor - OpenGL 3 (Compatibility) - AMD Radeon Graphics (radeonsi, renoir, LLVM 19.1.1, DRM 3.57, 6.8.0-53-lowlatency) - AMD Ryzen 9 4900HS with Radeon Graphics (16 threads)
### Issue description
In a web export, `DisplayServer.tts_get_voices` returns an empty array on the first load (in the `_ready` function of an autoload).
After refreshing (some kind of cache effect?), the array is no longer empty.
(Tested using Firefox.)
### Steps to reproduce
1. Run the Web export of the MRP. (Be sure that you have no other existing instances of the web export opened.)
2. Observe that no voices are listed.
3. Refresh.
4. Observe that voices are listed (assuming you have some installed)
(For reference, to install voices on Linux see [Text to speech / Requirements for functionality](https://docs.godotengine.org/en/stable/tutorials/audio/text_to_speech.html#requirements-for-functionality).)
### Minimal reproduction project (MRP)
[blind-game-test.zip](https://github.com/user-attachments/files/18950598/blind-game-test.zip)
Contributor guide
Research direction
Start with the minimal reproduction project and the DisplayServer.tts_get_voices call made in the autoload's _ready function. Compare the first web export load with a refreshed load in Firefox, and consider the issue resolved when installed voices are returned on the initial load.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- game-dev, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100