Documentation

Support

Vivox Unity SDK

Vivox Unity SDK

Queue a text-to-speech message

Queue a text-to-speech message for audio output.
Read time 1 minuteLast updated 2 days ago

Some destinations offer a built-in queuing system. When a new message is injected and there is an ongoing message playing, then the new message is put into a queue. After the ongoing message finishes playing, the next message in the queue automatically starts to play.
// Start playing speech as soon as it is synthesized.VivoxService.Instance.TextToSpeechSendMessage("1st Message.", TextToSpeechMessageType.QueuedLocalPlayback);// After the first message finishes playback, this message starts.VivoxService.Instance.TextToSpeechSendMessage("2nd Message.", TextToSpeechMessageType.QueuedLocalPlayback);
A queue is shared between
TextToSpeechMessageType.QueuedRemoteTransmission
and
TextToSpeechMessageType.QueuedRemoteTransmissionWithLocalPlayback
. The destination
TextToSpeechMessageType.QueuedLocalPlayback
has its own queue.
A destination queue can hold up to 10 enqueued messages in addition to the message that is actively playing. If a message is added when a destination queue is full, the Vivox SDK discards the message and raises an InvalidOperationException (
VxErrorTTSDestinationQueueIsFull
). In this case, no text-to-speech related events are raised.