Documentation

​
​

Development

User Acquisition

Monetization

Industry

Vivox Unreal SDK

Vivox Unreal SDK

Vivox
​
​
Vivox Unreal SDK
  • Overview
  • Get started
  • Release notes
  • Developer guide
  • Tutorials
  • Reference
    • Vivox Core Unreal class model overview
    • Vivox Unreal conventions
    • Unreal API Reference Manual
      • Class List
        • AccountId
        • Channel3DProperties
        • ChannelId
        • FVivoxCoreModule
        • IAudioDevice
        • IAudioDevices
        • IChannelConnectionState
        • IChannelSession
        • IChannelTextMessage
        • IClient
        • IDirectedTextMessage
        • ILoginSession
        • IParticipant
        • IParticipantProperties
        • IPresenceLocation
        • IPresenceSubscription
        • ITextMessage
        • ITextToSpeech
        • ITranscribedMessage
        • ITTSAudioBuffer
        • ITTSMessage
        • ITTSVoice
        • Presence
        • VivoxConfig
      • Deprecated List
    • Access Token Developer Guide
    • Server to Server Web API Reference Guide
    • Third-party license information
  1. Vivox Unreal SDK documentation

ITextToSpeech

Reference the ITextToSpeech interface for text-to-speech functionality.
Read time 5 minutes
Last updated 8 months ago

An interface for events and methods related to text-to-speech (TTS).
#include <ITextToSpeech.h>

Public Functions

Name

DECLARE_EVENT_ThreeParams(ITextToSpeech , PlaybackStarted , unsigned int , const ITTSMessage & , double )
DECLARE_EVENT_TwoParams(ITextToSpeech , PlaybackCompleted , unsigned int , const ITTSMessage & )
DECLARE_EVENT_TwoParams(ITextToSpeech , PlaybackFailed , VivoxCoreError , const ITTSMessage & )
virtual const TMap< FString, ITTSVoice * > &GetAvailableVoices() =0
All voices available to the text-to-speech subsystem for speech synthesis, indexed by name.
virtual const ITTSVoice &GetCurrentVoice() =0
The voice used by text-to-speech methods called from this ILoginSession.
virtual boolSetCurrentVoice(const ITTSVoice & newVoice) =0
Set the voice used by text-to-speech methods called from this ILoginSession.
virtual VivoxCoreErrorSpeak(const FString & text, const TTSDestination & destination, ITTSMessage ** outMessage =nullptr) =0
Inject a new text-to-speech (TTS) message into the specified destination.
virtual VivoxCoreErrorSpeakToBuffer(const FString & text, ITTSAudioBuffer ** outBuffer) =0
Inject a new text-to-speech message into an audio buffer for direct use.
virtual VivoxCoreErrorCancelMessage(const ITTSMessage & message) =0
Cancel a single currently playing or enqueued text-to-speech message.
virtual VivoxCoreErrorCancelDestination(const TTSDestination & destination) =0
Cancel all text-to-speech messages in a destination (ongoing and enqueued).
virtual VivoxCoreErrorCancelAll() =0
Cancel all text-to-speech messages (ongoing and enqueued) from all destinations.
virtual const TArray< ITTSMessage * > &GetMessages(const TTSDestination & destination) =0
Retrieve ongoing or enqueued text-to-speech (TTS) messages that were previously created by using Speak().

Public Attributes

Name

PlaybackStartedEventPlaybackStarted
An event that indicates a text-to-speech (TTS) message has finished preparing for playback and is starting to play.
PlaybackCompletedEventPlaybackCompleted
An event that indicates a text-to-speech (TTS) message has finished playback.
PlaybackFailedEventPlaybackFailed
An event that indicates playback of a text-to-speech message has failed.

Public Functions Documentation

function DECLARE_EVENT_ThreeParams

DECLARE_EVENT_ThreeParams( ITextToSpeech , PlaybackStarted , unsigned int , const ITTSMessage & , double )

function DECLARE_EVENT_TwoParams

DECLARE_EVENT_TwoParams( ITextToSpeech , PlaybackCompleted , unsigned int , const ITTSMessage & )

function DECLARE_EVENT_TwoParams

DECLARE_EVENT_TwoParams( ITextToSpeech , PlaybackFailed , VivoxCoreError , const ITTSMessage & )

function GetAvailableVoices

virtual const TMap< FString, ITTSVoice * > & GetAvailableVoices() =0
All voices available to the text-to-speech subsystem for speech synthesis, indexed by name.

function GetCurrentVoice

virtual const ITTSVoice & GetCurrentVoice() =0
The voice used by text-to-speech methods called from this ILoginSession.
Return: The voice previously set with SetCurrentVoice(), or the SDK default voice if never set.

function SetCurrentVoice

virtual bool SetCurrentVoice( const ITTSVoice & newVoice) =0
Set the voice used by text-to-speech methods called from this ILoginSession.
Parameters:
  • newVoice A valid ITTSVoice obtained from GetAvailableVoices() to use as this user's voice.
Return: True if a new value is set, false if a voice is not available (for example, if a voice is loaded from saved settings).

function Speak

virtual VivoxCoreError Speak( const FString & text, const TTSDestination & destination, ITTSMessage ** outMessage =nullptr) =0
Inject a new text-to-speech (TTS) message into the specified destination.
Parameters:
  • text The text to be converted into speech.
  • destination Determines the output stream and mechanism for TTS injection.
  • outMessage [out, optional] An object that holds properties related to this TTS message.
Remark: For information on how the ITTSVoice used for speech synthesis is selected, see GetCurrentVoice().

function SpeakToBuffer

virtual VivoxCoreError SpeakToBuffer( const FString & text, ITTSAudioBuffer ** outBuffer) =0
Inject a new text-to-speech message into an audio buffer for direct use.
Parameters:
  • text The text to be converted into speech.
  • outBuffer [out] An object that contains raw audio data and metadata, such as buffer length and audio format properties.
Remark: For information on how the ITTSVoice used for speech synthesis is selected, see GetCurrentVoice().

function CancelMessage

virtual VivoxCoreError CancelMessage( const ITTSMessage & message) =0
Cancel a single currently playing or enqueued text-to-speech message.
Parameters:
  • message The ITTSMessage to cancel.
Remark: In destinations with queues, canceling an ongoing message automatically triggers the playback of the next message. Canceling an enqueued message shifts all later messages up one place in the queue.

function CancelDestination

virtual VivoxCoreError CancelDestination( const TTSDestination & destination) =0
Cancel all text-to-speech messages in a destination (ongoing and enqueued).
Parameters:
  • destination The TTSDestination to clear of messages.
Remark: The TTSDestinations QueuedRemoteTransmission and QueuedRemoteTransmissionWithLocalPlayback share a queue, but are not the same destination. Canceling all messages in one of these destinations automatically triggers the playback of the next message from the other destination in the shared queue.

function CancelAll

virtual VivoxCoreError CancelAll() =0
Cancel all text-to-speech messages (ongoing and enqueued) from all destinations.

function GetMessages

virtual const TArray< ITTSMessage * > & GetMessages( const TTSDestination & destination) =0
Retrieve ongoing or enqueued text-to-speech (TTS) messages that were previously created by using Speak().
Parameters:
  • destination The TTSDestination to retrieve messages for.
Return: An array of all TTS messages that are playing or enqueued in the specified destination.

Public Attributes Documentation

variable EventPlaybackStarted

PlaybackStarted EventPlaybackStarted;
An event that indicates a text-to-speech (TTS) message has finished preparing for playback and is starting to play.
Parameters:
  • numConsumers The number of active sessions (for remote playback destinations), local players (for local playback destinations), or both, that the TTS message is playing into.
  • message The ITTSMessage that corresponds to this speech.
  • messageDuration The duration of the synthesized voice clip in seconds.

variable EventPlaybackCompleted

PlaybackCompleted EventPlaybackCompleted;
An event that indicates a text-to-speech (TTS) message has finished playback.
Parameters:
  • numConsumers The number of active sessions (for remote playback destinations), local players (for local playback destinations), or both, that the TTS message is playing into.
  • message The ITTSMessage that corresponds to this speech.
Remark: This event is raised regardless of whether playback is stopped early by using the various Cancel*() methods, is replaced by a new message (TTSDestination.ScreenReader only), or if the voice clip has reached its natural end. When this event is received, the correponding ITTSMessage can no longer be obtained by using GetMessages().

variable EventPlaybackFailed

PlaybackFailed EventPlaybackFailed;
An event that indicates playback of a text-to-speech message has failed.
Parameters:
  • status The error code of the failure.
  • message The ITTSMessage that corresponds to this speech.
Remark: When this event is received, the correponding ITTSMessage can no longer be obtained by using GetMessages().

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Public Functions

    • Public Attributes

    • Public Functions Documentation

      • function DECLARE_EVENT_ThreeParams

      • function DECLARE_EVENT_TwoParams

      • function DECLARE_EVENT_TwoParams

      • function GetAvailableVoices

      • function GetCurrentVoice

      • function SetCurrentVoice

      • function Speak

      • function SpeakToBuffer

      • function CancelMessage

      • function CancelDestination

      • function CancelAll

      • function GetMessages

    • Public Attributes Documentation

      • variable EventPlaybackStarted

      • variable EventPlaybackCompleted

      • variable EventPlaybackFailed


Report a problem with this page