Important: This is documentation for the legacy version of the Vivox Unity SDK. This documentation will be removed after July 2025. Refer to the v16 documentation for the new version of the SDK.

Text-to-speech events

The SDK can sometimes raise the following ITTSMessageQueue text-to-speech (TTS) events.

Note: You can bind to these events by using ILoginSession.TTS.Messages.

  • AfterMessageAdded - Raised when a TTS message is added to the text-to-speech subsystem.

    • Message - The TTSMessage that was added as a result of a call to Speak() or Enqueue().
  • AfterMessageUpdated - Raised when a TTS message has finished preparing for playback and is starting to play.

    • Message - The TTSMessage that corresponds to this speech.
    • Duration - The duration of the synthesized voice clip in seconds.
    • NumConsumers - The number of active sessions (for remote playback destinations) or local players (for local playback destinations), or both, that the TTS message was injected into.
  • BeforeMessageRemoved - Raised when a TTS message is removed from the text-to-speech subsystem.

    • Message - The TTSMessage whose playback has naturally completed or was prematurely canceled.