TtsModule
The TtsModule class manages text-to-speech functionality, allowing the system to generate spoken audio from text.
Methods
public void SendText(string text, string lang = null)
Description: Sends text to be converted into speech.
Parameters:
string text: The text to be spoken.string lang: An optional language code. If not provided, it uses the currently set language.
public void SetLanguage(string language, string voice, string tts = "polly", bool neural = true)
Description: Sets the language and voice for the text-to-speech system. This method internally makes two separate calls: one to set the language and another to configure the TTS provider, voice, and neural setting.
Parameters:
string language: The language code (e.g., 'en-US').string voice: The name of the specific voice to use (e.g., 'Matthew').string tts: The text-to-speech provider. Defaults to "polly".bool neural: A flag indicating whether to use a neural voice. Defaults totrue.