![]() |
BogaNet 1.4.0
|
Main component for TTS-operations. More...
Public Member Functions | |
float | ApproximateSpeechLength (string text, float rate=1f, float wordsPerMinute=175f, float timeFactor=0.9f) |
Approximates the speech length in seconds of a given text and rate. NOTE: This method does not provide an exact value; +/- 15% is "normal"! | |
bool | IsVoiceForGenderAvailable (Gender gender, string culture="") |
Is a voice available for a given gender and optional culture from the current TTS-system? | |
bool | IsVoiceForGenderAvailable (Gender gender, CultureInfo culture) |
Is a voice available for a given gender and language from the current TTS-system? | |
List< Voice > | VoicesForGender (Gender gender, string culture="", bool isFuzzy=false) |
Get all available voices for a given gender and optional culture from the current TTS-system. | |
List< Voice > | VoicesForGender (Gender gender, CultureInfo culture, bool isFuzzy=false) |
Get all available voices for a given gender and language from the current TTS-system. | |
Voice? | VoiceForGender (Gender gender, string culture="", int index=0, string fallbackCulture="en", bool isFuzzy=false) |
Get a voice from for a given gender, optional culture and optional index from the current TTS-system. | |
Voice? | VoiceForGender (Gender gender, CultureInfo culture, int index=0, bool isFuzzy=false) |
Get a voice from for a given gender, language and index from the current TTS-system. | |
bool | IsVoiceForCultureAvailable (string culture) |
Is a voice available for a given culture from the current TTS-system? | |
bool | IsVoiceForLanguageAvailable (CultureInfo culture) |
Is a voice available for a given language from the current TTS-system? | |
List< Voice > | VoicesForCulture (string culture, bool isFuzzy=false) |
Get all available voices for a given culture from the current TTS-system. | |
List< Voice > | VoicesForLanguage (CultureInfo culture, bool isFuzzy=false) |
Get all available voices for a given language from the current TTS-system. | |
Voice? | VoiceForCulture (string culture, int index=0, string fallbackCulture="en", bool isFuzzy=false) |
Get a voice from for a given culture and optional index from the current TTS-system. | |
Voice? | VoiceForLanguage (CultureInfo culture, int index=0, bool isFuzzy=false) |
Get a voice from for a given language and optional index from the current TTS-system. | |
bool | IsVoiceForNameAvailable (string _name, bool isExact=false) |
Is a voice available for a given name from the current TTS-system? | |
Voice? | VoiceForName (string _name, bool isExact=false) |
Get a voice for a given name from the current TTS-system. | |
List< Voice > | GetVoices () |
Get all available voices from the current TTS-provider as a list. | |
async Task< List< Voice > > | GetVoicesAsync () |
Get all available voices from the current TTS-provider as a list asynchronously. | |
void | Silence () |
Silence all active TTS speeches. | |
bool | Speak (string text, Voice? voice=null, float rate=1, float pitch=1, float volume=1, bool forceSSML=true, bool useThreaded=false) |
The current provider speaks a text with a given voice. | |
async Task< bool > | SpeakAsync (string text, Voice? voice=null, float rate=1, float pitch=1, float volume=1, bool forceSSML=true) |
The current provider speaks a text with a given voice asynchronously. | |
![]() | |
delegate void | VoicesLoaded (List< Voice > voices) |
Delegate for the load status of the voices. | |
delegate void | SpeakStarted (string text) |
Delegate for the speak status. | |
delegate void | SpeakCompleted (string text) |
Delegate for the speak status. | |
Protected Member Functions | |
Speaker () | |
Properties | |
IVoiceProvider? | CustomVoiceProvider [get, set] |
Custom voice provider. | |
bool | UseESpeak [get, set] |
Enable or disable eSpeak for standalone platforms. | |
bool | IsTTSAvailable [get] |
Checks if TTS is available on this system. | |
List< Voice > | Voices [get] |
Get all available voices from the current TTS-provider and fills it into a given list. | |
int | MaxTextLength [get] |
Maximal length of the speech text (in characters). | |
bool | IsPlatformSupported [get] |
Indicates if this provider is supporting the current platform. | |
bool | IsSSMLSupported [get] |
Indicates if this provider is supporting SSML. | |
List< string > | Cultures [get] |
Get all available cultures from the current provider (ISO 639-1). | |
bool | IsReady [get] |
Is the provider ready to use? | |
bool | IsSpeaking [get] |
Is the provider currently speaking? | |
string | ESpeakApplication [get, set] |
eSpeak application name/path. | |
string | ESpeakDataPath [get, set] |
eSpeak application data path. | |
ESpeakModifiers | ESpeakModifier [get, set] |
Active modifier for all eSpeak voices. | |
ESpeakModifiers | ESpeakFemaleModifier [get, set] |
Female modifier for female eSpeak voices. | |
![]() | |
static T | Instance [get] |
![]() |
Events | |
IVoiceProvider.? VoicesLoaded | OnVoicesLoaded |
IVoiceProvider.? SpeakStarted | OnSpeakStarted |
IVoiceProvider.? SpeakCompleted | OnSpeakCompleted |
![]() | |
VoicesLoaded | OnVoicesLoaded |
Event triggered whenever the voices are loaded. | |
SpeakStarted | OnSpeakStarted |
Event triggered whenever a speech is started. | |
SpeakCompleted | OnSpeakCompleted |
Event triggered whenever a speech is completed. | |
Main component for TTS-operations.
|
protected |
float BogaNet.TTS.Speaker.ApproximateSpeechLength | ( | string | text, |
float | rate = 1f, | ||
float | wordsPerMinute = 175f, | ||
float | timeFactor = 0::9f ) |
Approximates the speech length in seconds of a given text and rate. NOTE: This method does not provide an exact value; +/- 15% is "normal"!
text | Text for the length approximation. |
rate | Speech rate of the speaker in percent for the length approximation (1 = 100%, default: 1, optional). |
wordsPerMinute | Words per minute (default: 175, optional). |
timeFactor | Time factor for the calculated value (default: 0.9, optional). |
List< Voice > BogaNet.TTS.Speaker.GetVoices | ( | ) |
Get all available voices from the current TTS-provider as a list.
Implements BogaNet.TTS.Provider.IVoiceProvider.
async Task< List< Voice > > BogaNet.TTS.Speaker.GetVoicesAsync | ( | ) |
Get all available voices from the current TTS-provider as a list asynchronously.
Implements BogaNet.TTS.Provider.IVoiceProvider.
bool BogaNet.TTS.Speaker.IsVoiceForCultureAvailable | ( | string | culture | ) |
Is a voice available for a given culture from the current TTS-system?
culture | Culture of the voice (e.g. "en") |
bool BogaNet.TTS.Speaker.IsVoiceForGenderAvailable | ( | Gender | gender, |
CultureInfo | culture ) |
Is a voice available for a given gender and language from the current TTS-system?
gender | Gender of the voice |
culture | Culture of the voice |
bool BogaNet.TTS.Speaker.IsVoiceForGenderAvailable | ( | Gender | gender, |
string | culture = "" ) |
Is a voice available for a given gender and optional culture from the current TTS-system?
gender | Gender of the voice |
culture | Culture of the voice (e.g. "en", optional) |
bool BogaNet.TTS.Speaker.IsVoiceForLanguageAvailable | ( | CultureInfo | culture | ) |
Is a voice available for a given language from the current TTS-system?
culture | Culture of the voice |
bool BogaNet.TTS.Speaker.IsVoiceForNameAvailable | ( | string | _name, |
bool | isExact = false ) |
Is a voice available for a given name from the current TTS-system?
_name | Name of the voice (e.g. "Alex") |
isExact | Exact match for the voice name (default: false, optional) |
void BogaNet.TTS.Speaker.Silence | ( | ) |
Silence all active TTS speeches.
Implements BogaNet.TTS.Provider.IVoiceProvider.
bool BogaNet.TTS.Speaker.Speak | ( | string | text, |
Voice? | voice = null, | ||
float | rate = 1, | ||
float | pitch = 1, | ||
float | volume = 1, | ||
bool | forceSSML = true, | ||
bool | useThreads = false ) |
The current provider speaks a text with a given voice.
text | Text to speak. |
voice | Voice to speak (optional). |
rate | Speech rate of the speaker in percent (1 = 100%, values: 0.01-3, default: 1, optional). |
pitch | Pitch of the speech in percent (1 = 100%, values: 0-2, default: 1, optional). |
volume | Volume of the speaker in percent (1 = 100%, values: 0.01-1, default: 1, optional). |
forceSSML | Force SSML on supported platforms (default: true, optional). |
useThreads | Allows to run every Speak-call on a separate thread (default: false, optional). |
Implements BogaNet.TTS.Provider.IVoiceProvider.
async Task< bool > BogaNet.TTS.Speaker.SpeakAsync | ( | string | text, |
Voice? | voice = null, | ||
float | rate = 1, | ||
float | pitch = 1, | ||
float | volume = 1, | ||
bool | forceSSML = true ) |
The current provider speaks a text with a given voice asynchronously.
text | Text to speak. |
voice | Voice to speak (optional). |
rate | Speech rate of the speaker in percent (1 = 100%, values: 0.01-3, default: 1, optional). |
pitch | Pitch of the speech in percent (1 = 100%, values: 0-2, default: 1, optional). |
volume | Volume of the speaker in percent (1 = 100%, values: 0.01-1, default: 1, optional). |
forceSSML | Force SSML on supported platforms (default: true, optional). |
Implements BogaNet.TTS.Provider.IVoiceProvider.
Voice? BogaNet.TTS.Speaker.VoiceForCulture | ( | string | culture, |
int | index = 0, | ||
string | fallbackCulture = "en", | ||
bool | isFuzzy = false ) |
Get a voice from for a given culture and optional index from the current TTS-system.
culture | Culture of the voice (e.g. "en") |
index | Index of the voice (default: 0, optional) |
fallbackCulture | Fallback culture of the voice (default "en", optional) |
isFuzzy | Always returns voices if there is no match with the culture (default: false, optional) |
Voice? BogaNet.TTS.Speaker.VoiceForGender | ( | Gender | gender, |
CultureInfo | culture, | ||
int | index = 0, | ||
bool | isFuzzy = false ) |
Get a voice from for a given gender, language and index from the current TTS-system.
gender | Gender of the voice |
culture | Culture of the voice |
index | Index of the voice (default: 0, optional) |
isFuzzy | Always returns voices if there is no match with the gender and/or language (default: false, optional) |
Voice? BogaNet.TTS.Speaker.VoiceForGender | ( | Gender | gender, |
string | culture = "", | ||
int | index = 0, | ||
string | fallbackCulture = "en", | ||
bool | isFuzzy = false ) |
Get a voice from for a given gender, optional culture and optional index from the current TTS-system.
gender | Gender of the voice |
culture | Culture of the voice (e.g. "en", optional) |
index | Index of the voice (default: 0, optional) |
fallbackCulture | Fallback culture of the voice (default "en", optional) |
isFuzzy | Always returns voices if there is no match with the gender and/or culture (default: false, optional) |
Voice? BogaNet.TTS.Speaker.VoiceForLanguage | ( | CultureInfo | culture, |
int | index = 0, | ||
bool | isFuzzy = false ) |
Get a voice from for a given language and optional index from the current TTS-system.
culture | Culture of the voice |
index | Index of the voice (default: 0, optional) |
isFuzzy | Always returns voices if there is no match with the language (default: false, optional) |
Voice? BogaNet.TTS.Speaker.VoiceForName | ( | string | _name, |
bool | isExact = false ) |
Get a voice for a given name from the current TTS-system.
_name | Name of the voice (e.g. "Alex") |
isExact | Exact match for the voice name (default: false, optional) |
List< Voice > BogaNet.TTS.Speaker.VoicesForCulture | ( | string | culture, |
bool | isFuzzy = false ) |
Get all available voices for a given culture from the current TTS-system.
culture | Culture of the voice (e.g. "en") |
isFuzzy | Always returns voices if there is no match with the culture (default: false, optional) |
List< Voice > BogaNet.TTS.Speaker.VoicesForGender | ( | Gender | gender, |
CultureInfo | culture, | ||
bool | isFuzzy = false ) |
Get all available voices for a given gender and language from the current TTS-system.
gender | Gender of the voice |
culture | Culture of the voice |
isFuzzy | Always returns voices if there is no match with the gender and/or language (default: false, optional) |
List< Voice > BogaNet.TTS.Speaker.VoicesForGender | ( | Gender | gender, |
string | culture = "", | ||
bool | isFuzzy = false ) |
Get all available voices for a given gender and optional culture from the current TTS-system.
gender | Gender of the voice |
culture | Culture of the voice (e.g. "en", optional) |
isFuzzy | Always returns voices if there is no match with the gender and/or culture (default: false, optional) |
List< Voice > BogaNet.TTS.Speaker.VoicesForLanguage | ( | CultureInfo | culture, |
bool | isFuzzy = false ) |
Get all available voices for a given language from the current TTS-system.
culture | Culture of the voice |
isFuzzy | Always returns voices if there is no match with the language (default: false, optional) |
|
get |
Get all available cultures from the current provider (ISO 639-1).
Implements BogaNet.TTS.Provider.IVoiceProvider.
|
getset |
Custom voice provider.
|
getset |
eSpeak application name/path.
|
getset |
eSpeak application data path.
|
getset |
Female modifier for female eSpeak voices.
|
getset |
Active modifier for all eSpeak voices.
|
get |
Indicates if this provider is supporting the current platform.
Implements BogaNet.TTS.Provider.IVoiceProvider.
|
get |
Is the provider ready to use?
Implements BogaNet.TTS.Provider.IVoiceProvider.
|
get |
Is the provider currently speaking?
Implements BogaNet.TTS.Provider.IVoiceProvider.
|
get |
Indicates if this provider is supporting SSML.
Implements BogaNet.TTS.Provider.IVoiceProvider.
|
get |
Checks if TTS is available on this system.
|
get |
Maximal length of the speech text (in characters).
Implements BogaNet.TTS.Provider.IVoiceProvider.
|
getset |
Enable or disable eSpeak for standalone platforms.
|
get |
Get all available voices from the current TTS-provider and fills it into a given list.
Implements BogaNet.TTS.Provider.IVoiceProvider.
IVoiceProvider.? SpeakCompleted BogaNet.TTS.Speaker.OnSpeakCompleted |
IVoiceProvider.? SpeakStarted BogaNet.TTS.Speaker.OnSpeakStarted |
IVoiceProvider.? VoicesLoaded BogaNet.TTS.Speaker.OnVoicesLoaded |