Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

3
I can't get TTS to fully work in C#
Post Flair (click to view more posts with a particular flair)
Post Body

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);
}

}

Images
Author
Account Strength
100%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,822
Link Karma
950
Comment Karma
809
Profile updated: 6 days ago
Posts updated: 4 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 months ago