Cancel a text-to-speech message

To cancel a currently playing or enqueued text-to-speech (TTS) message, use VivoxService.Instance.TextToSpeechCancelMessages() or VivoxService.Instance.TextToSpeechCancelAllMessages() with the TTS Message that you want to cancel. You can also use the Dequeue() method on any ITTS Message collection to cancel the message at the head of the queue.

You can directly cancel any TTS Message object that was previously spoken by using VivoxService.Instance.TextToSpeechCancelMessages(). This is detailed in the following example:

VivoxService.Instance.TextToSpeechSendMessage()

In destinations that contain queues, canceling an ongoing TTS message automatically triggers playback of the next message. Canceling an enqueued TTS message shifts all later messages up one place in the queue.

You can cancel all TTS messages in a destination (ongoing and enqueued), or all TTS messages in all destinations.

// Cancel all TTS messages in the destination for Queued Local Playback
VivoxService.Instance.TextToSpeechCancelMessages(TextToSpeechMessageType);

// Cancel all TTS messages in all destinations
VivoxService.Instance.TextToSpeechCancelAllMessages();