Godot Version
4.4.1
Question
Hi! I’m having an issue that I can’t seem to track down. My game has a mode to play with TTS and it works fine on all exported platforms (Windows, Mac, Linux) but when the game is launched via Steam, I get this error:
ERROR: Parameter "synth" is null.
at: get_voices (platform/linuxbsd/tts_linux.cpp:195)
GETTING ALL TTS VOICES ---> []
ERROR: Parameter "synth" is null.
at: get_voices (platform/linuxbsd/tts_linux.cpp:195)
No voices found for language en
The curios thing is that if I go to the local steamapps folder and launch the game myself, TTS runs fine so I suspect that the Steam wrapper might mess somehow with the DisplayServer? It happens on Linux and Mac but not Windows. I’m developing and building on Linux Mint and tried building from Windows to compare, same issue. I have no clue where to start looking for the issue.
Here’s the log when launching without Steam:
GETTING ALL TTS VOICES ---> [
{ "name": "samantha", "id": "samantha", "language": "en-US_none" },
{ "name": "serena", "id": "serena", "language": "en-GB_none" },
{ "name": "sabrina", "id": "sabrina", "language": "de-DE_none" },
{ "name": "isabel", "id": "isabel", "language": "es-ES_none" },
{ "name": "virginie", "id": "virginie", "language": "fr-FR_none" },
{ "name": "silvia", "id": "silvia", "language": "it-IT_none" }
]
The TTS-mode is a big feature for my game so it not working on Steam is very unfortunate.
Here’s the code of loading the voices at startup:
func load_voices(_language: String = DEFAULT_LANGUAGE) -> Array:
voices.clear()
# Get voice based on the the OS.
print("GETTING ALL TTS VOICES ---> %s" % str(DisplayServer.tts_get_voices()))
match OS.get_name():
"Windows":
# Gets the first part of the language string
voices_paths = DisplayServer.tts_get_voices_for_language(_language.split("-")[0])
for voice in voices_paths:
var voice_string = voice.split("-")[1]
var voice_name = voice_string.split("_")[1]
voices.append(voice_name)
print(voices)
"Linux":
# Uses the whole language-locale string
voices_paths = DisplayServer.tts_get_voices_for_language(_language)
for voice in voices_paths:
if voice.contains("+"):
var voice_name = voice.split("+")[1]
voices.append(voice_name)
else:
voices.append(voice)
"macOS":
# Gets the first part of the language string
voices_paths = DisplayServer.tts_get_voices_for_language(_language.split("-")[0])
print(voices_paths)
for voice in voices_paths:
if voice.contains("."):
var parts = voice.split(".")
voices.append(parts[parts.size()-1])
else:
voices.append(voice)
# If voices are empty, print an error and return.
if voices.is_empty():
printerr("No voices found for language %s" % _language)
return []
return voices
Any idea where I could start looking? Or what the issue could be?