Cancel a text-to-speech message

To cancel a currently playing or enqueued text-to-speech (TTS) message, use ITextToSpeech::CancelMessage() with the ITTSMessage that you want to cancel. For example:

ITTSMessage *Message;
MyLoginSession->TTS().Speak("Some Text", TTSDestination::RemoteTransmission, &Message);

MyLoginSession->TTS().CancelMessage(*Message);

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
MyLoginSession->TTS().CancelDestination(TTSDestination::QueuedLocalPlayback);

// Cancel all TTS messages in all destinations
MyLoginSession->TTS().CancelAll();