文档

​
​

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. 语音转文本音频听录

取消文本转语音消息

Cancel a queued text-to-speech message.
阅读时间1 分钟
最后更新于 8 个月前

要取消当前正在播放或已排队的文本转语音 (TTS) 消息,请将
VivoxService.Instance.TextToSpeechCancelMessages()
或
VivoxService.Instance.TextToSpeechCancelAllMessages()
与要取消的 TTS 消息结合使用。还可以对任何 ITTS 消息集合使用
Dequeue()
方法,以取消队列头部的消息。
以前说过的任何 TTSMessage 对象都可以使用
VivoxService.Instance.TextToSpeechCancelMessages()
直接取消。以下示例进行了详细说明:
VivoxService.Instance.TextToSpeechSendMessage()
在包含队列的目标中,取消正在进行的 TTS 消息将自动触发下一条消息的播放。取消已排队的 TTS 消息会将队列中的所有后续消息上移一个位置。
可以取消一个目标中的所有 TTS 消息(正在进行和已排队的)或所有目标中的所有 TTS 消息。
// Cancel all TTS messages in the destination for Queued Local PlaybackVivoxService.Instance.TextToSpeechCancelMessages(TextToSpeechMessageType);// Cancel all TTS messages in all destinationsVivoxService.Instance.TextToSpeechCancelAllMessages();

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

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

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


    报告此页面的问题