文档

​
​

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

注入文本转语音消息

Inject a text-to-speech message into Vivox channels.
阅读时间1 分钟
最后更新于 8 个月前

若要将文本转语音 (TTS) 消息注入频道或本地音频,请使用
VivoxService.Instance.TextToSpeechSendMessage(string message, TextToSpeechMessageType messageType)
。每种方法都采用一个 string 和一个 TextToSpeechMessageType 参数,指定要合成的文本以及要注入合成文本的目标。TTSMessage 的 Voice 属性和 State 属性在函数成功完成时由函数进行更新。
注入到文本转语音子系统中之后,TTS 消息引用随后可以用于取消该消息。如果不希望持有消息,则可以将来在消息保留在
VivoxService.Instance.TextToSpeechCancelMessages()
集合中期间,获取任何以前注入的消息,直到消息被取消或播放结束。
VivoxService.Instance.TextToSpeechSendMessage("Hello All", TextToSpeechMessageType.QueuedLocalPlayback);
如果多个 TTS 用户处于一个语音或文本频道中,则可在发送 TTS 消息的用户的显示名称中添加前缀。例如,“[Display name] 指出…”

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

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

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


    报告此页面的问题