文档

​
​

Development

User Acquisition

Monetization

工业

Vivox Unity SDK

Vivox Unity SDK

Vivox
​
​
Vivox Unity SDK
  • Overview
  • Get started
  • Release notes
  • Developer guide
    • Set up your project
    • Create voice and text channels
    • Messaging
    • Player management
    • Device management
    • Audio management
    • Mobile development
    • Text-to-speech
      • Text-to-speech voice options
      • Text-to-speech destinations
      • Inject a text-to-speech message
      • Queue a text-to-speech message
      • Cancel a text-to-speech message
    • Speech-to-text
    • Real-time recording
    • Server-side-recording
    • Troubleshooting
  • Tutorials
  • Reference
  1. Vivox Unity SDK 文档
  2. Vivox Unity 开发者指南
  3. 语音转文本音频听录

对文本转语音消息排队

Queue a text-to-speech message for audio output.
阅读时间1 分钟
最后更新于 8 个月前

有些目标会提供内置排队系统。如果注入新消息时正在播放消息,则将新消息放入队列。正在进行的消息播放完成后,队列中的下一条消息将自动开始播放。
// 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);
队列在
TextToSpeechMessageType.QueuedRemoteTransmission
与
TextToSpeechMessageType.QueuedRemoteTransmissionWithLocalPlayback
之间共享。目标
TextToSpeechMessageType.QueuedLocalPlayback
具有自己的队列。
目标队列可以持有 10 个已排队消息以及在主动播放的消息。如果在目标队列已满时添加消息,Vivox SDK 将放弃该消息并引发 InvalidOperationException (
VxErrorTTSDestinationQueueIsFull
)。在此情况下,不引发任何文本转语音相关事件。

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。


    报告此页面的问题