This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I can't seem to hear any TTS voices. I tried to follow a tutorial that accomplished it via GDscript, but since I'm way more familiar with C# than I am with GDscript, I wanted to try replicating it in C#. For the most part, it does seem to work, except for the playback of the voices. Below you can find the code of the node I was testing it in, along with some screenshots to show how it behaves in action, and the checked box for TTS in Godot. Restarted both the program and my laptop, and it still didn't fix anything. Is there something in the code or another setting I overlooked?
using Godot; using System;
public partial class Main : Control { Button SpeakButton; TextEdit TextInput; OptionButton VoiceOptions; Godot.Collections.Array<Godot.Collections.Dictionary> Voices;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
Voices = new Godot.Collections.Array<Godot.Collections.Dictionary>(DisplayServer.TtsGetVoices());
SpeakButton = GetNode<Button>("SpeakButton");
TextInput = GetNode<TextEdit>("TextInput");
VoiceOptions = GetNode<OptionButton>("Voices");
for (int i = 0; i < Voices.Count; i )
{
GD.Print(Voices[i]);
VoiceOptions.AddItem(Voices[i]["name"].ToString());
}
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
public void OnSpeakButtonPressed()
{
string Voice = Voices[VoiceOptions.GetSelectedId()]["id"].ToString();
DisplayServer.TtsSpeak(TextInput.Text, Voice);
GD.Print(TextInput.Text, Voice);
}
}
Post Details
- Posted
- 2 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/gallery/1gew6...