Queue a text-to-speech message
Queue a text-to-speech message for audio output.
Read time 1 minuteLast updated 7 months 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 and . The destination has its own queue.
TextToSpeechMessageType.QueuedRemoteTransmissionTextToSpeechMessageType.QueuedRemoteTransmissionWithLocalPlaybackTextToSpeechMessageType.QueuedLocalPlaybackA 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 (). In this case, no text-to-speech related events are raised.
VxErrorTTSDestinationQueueIsFull