Navigation
API > API/Plugins > API/Plugins/TextToSpeech
Abstract base class for all text to speech engines. Subclass for each new speech synthesis method to be used. Text to speech takes in an FString and synthesizes audio data based on the text using the underlying speech synthesizer.
| Name | FTextToSpeechBase |
| Type | class |
| Header File | /Engine/Plugins/Experimental/TextToSpeech/Source/TextToSpeech/Public/GenericPlatform/TextToSpeechBase.h |
| Include Path | #include "GenericPlatform/TextToSpeechBase.h" |
Syntax
class FTextToSpeechBase : public TSharedFromThis< FTextToSpeechBase >
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → FTextToSpeechBase
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTextToSpeechBase() |
GenericPlatform/TextToSpeechBase.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FTextToSpeechBase() |
GenericPlatform/TextToSpeechBase.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnTextToSpeechFinishSpeaking | TBaseDelegate_NoParams< void > | A delegate that fires when the underlying text to speech has successfully finished speaking the requested string | GenericPlatform/TextToSpeechBase.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| InvalidTextToSpeechId | const TextToSpeechId | GenericPlatform/TextToSpeechBase.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bActive | bool | True if the TTS is active. Elsxe false | GenericPlatform/TextToSpeechBase.h | |
| bMuted | bool | True if the TTS is muted. Else false. | GenericPlatform/TextToSpeechBase.h | |
| Id | TextToSpeechId | The runtime ID for this TTS object. | GenericPlatform/TextToSpeechBase.h | |
| TextToSpeechFinishSpeakingDelegate | FOnTextToSpeechFinishSpeaking | The delegate that is called when the TTS successfully finishes speaking a string. | GenericPlatform/TextToSpeechBase.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Activate () |
Activates the TTS system and does the necessary set up. | GenericPlatform/TextToSpeechBase.h | |
void Deactivate () |
Deactivates the TTS and performs tear down. | GenericPlatform/TextToSpeechBase.h | |
TextToSpeechId GetId() |
Returns the ID associated with this text to speech object | GenericPlatform/TextToSpeechBase.h | |
bool IsActive() |
Returns true if the TTS is active. Else false. | GenericPlatform/TextToSpeechBase.h | |
bool IsMuted() |
Returns true if the TTS is muted. Else false. | GenericPlatform/TextToSpeechBase.h | |
bool IsSpeaking() |
Returns true if any string is currently being spoken, else false. | GenericPlatform/TextToSpeechBase.h | |
| This should only be called by text to speech implementations to signal that a requessted string has successfully finished speaking. | GenericPlatform/TextToSpeechBase.h | ||
void SetTextToSpeechFinishedSpeakingDelegate
(
const FOnTextToSpeechFinishSpeaking& Delegate |
Sets the TextToSpeechFinishedSpeakingDelegate | GenericPlatform/TextToSpeechBase.h | |
| Immediately speaks the requested string. | GenericPlatform/TextToSpeechBase.h | ||
void StopSpeaking() |
Immediately stops speaking the current string being spoken | GenericPlatform/TextToSpeechBase.h |
Public Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual float GetRate() |
Returns the current speech rate strings are spoken at. Value is between 0 and 1.0f. | GenericPlatform/TextToSpeechBase.h | |
virtual float GetVolume() |
Returns the current volume being spoken at. Value is between 0 and 1.0f. | GenericPlatform/TextToSpeechBase.h | |
virtual void Mute() |
Mutes the TTS so no synthesized speech is audible | GenericPlatform/TextToSpeechBase.h | |
virtual void SetRate
(
float InRate |
Sets the current speech rate strings should be spoken at. Clamps to 0 and 1.0f. | GenericPlatform/TextToSpeechBase.h | |
virtual void SetVolume
(
float InVolume |
Sets the volume for strings to be spoken at. Clamps to 0 and 1.0f. | GenericPlatform/TextToSpeechBase.h | |
virtual void Unmute() |
Unmutes the TTS so requests to speak strings are audible again. | GenericPlatform/TextToSpeechBase.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void SetMuted
(
bool bInMuted |
Sets the flag for whether the TTS is muted | GenericPlatform/TextToSpeechBase.h |
Protected Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnActivated() |
Called at the end of Activate() Override in child classes to provide additional set up. | GenericPlatform/TextToSpeechBase.h | |
virtual void OnDeactivated() |
Called at the start of Deactivate() Override in child classes to provide additional tear down | GenericPlatform/TextToSpeechBase.h |