Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisplayServer tts_get_voices() does not load all installed voices on Windows #69788

Open
Xyotic opened this issue Dec 9, 2022 · 7 comments
Open

Comments

@Xyotic
Copy link

Xyotic commented Dec 9, 2022

Godot version

4.0 beta 7

System information

Windows 10

Issue description

The current implementation of tts_get_voices seems to only load voices that are referenced inside the registry under

"Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens"

But many of windows voices are located under:

"Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens"

Providing the path to these voices to tts_speak however, doesnt seem to work at the moment...

Steps to reproduce

Call tts_get_voices() and compare it to your installed voices and registry

Minimal reproduction project

TTS_Bug.zip

@bruvzg
Copy link
Member

bruvzg commented Dec 9, 2022

tts_get_voices is not reading registry directly, it's listing voices returned by Windows Speech API 5.4.

There are other voices that aren't registered in SAPI and won't work, this is not a bug, but a restriction imposed by Microsoft (probably for licensing reasons), see https://www.ghacks.net/2018/08/11/unlock-all-windows-10-tts-voices-system-wide-to-get-more-of-them/ for example.

@akien-mga akien-mga added discussion and removed bug labels Dec 9, 2022
@akien-mga akien-mga removed this from the 4.0 milestone Dec 9, 2022
@Xyotic
Copy link
Author

Xyotic commented Dec 9, 2022

Would it be possible to use some open source tts library instead?

The current implementation seems a bit limited then, and it would sound different per platform...

Just throwing ideas out.

@Calinou
Copy link
Member

Calinou commented Dec 9, 2022

Would it be possible to use some open source tts library instead?

We can't bundle TTS soundfonts as we need to keep the binary size low. Also, last time I checked, open source TTS solutions are notorious for being behind proprietary OS-level solutions in terms of output quality.

We can document how to unlock the full range of TTS voices in the meantime, in a way that you can link to your project's users if they wish.

@lesleyrs
Copy link

tts_get_voices is not reading registry directly, it's listing voices returned by Windows Speech API 5.4.

There are other voices that aren't registered in SAPI and won't work, this is not a bug, but a restriction imposed by Microsoft (probably for licensing reasons), see https://www.ghacks.net/2018/08/11/unlock-all-windows-10-tts-voices-system-wide-to-get-more-of-them/ for example.

Ok this makes sense. I noticed something weird where exporting to web loads the default system voice on Windows 10 (even without visibly showing it) which desktop doesn't have access to.

Not that it matters as tts keeps cutting off on web and generally doesn't work, but just pointing it out.

@lesleyrs
Copy link

@bruvzg I just tried https://github.com/ndarilek/tts-rs which uses WinRT and that does not have the voice limitation on windows. Any voices I add in settings is able to load.

While on Godot only some English voices appear, this would fix the issue.

@bruvzg
Copy link
Member

bruvzg commented Apr 14, 2023

I have done some testing, and it is possible to use WinRT API from C++ app like Godot, but there are a few issues with it:

  • MinGW seems to be missing required headers, so it's MSVC only (official builds are done with MinGW, and it's a recommended way to build the engine, since MSVC builds have bad GDScript performance).
  • It's Windows 10/11 only, Godot is currently targeting Windows 7+ compatibility. So some stuff should be dynamically loaded (not sure how it will work with WinRT API).
  • It's a completely different API, so a new TTS implementation is necessary.

@Leroy-X
Copy link

Leroy-X commented Sep 29, 2023

Hi, @lesleyrs I have test tts tui, it's so ease to used, but how to use the natural voice in Win11 Narrator.
The quality of natural voice is higher, look forward to adding natural voice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants