文档

​
​

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
    • Speech-to-text
      • Audio transcription conditions
      • Speech-to-text API
      • Speech-to-text and audio injection
    • Real-time recording
    • Server-side-recording
    • Troubleshooting
  • Tutorials
  • Reference
  1. Vivox Unity SDK 文档

语音转文本 API

Use the speech-to-text API to transcribe voice messages.
阅读时间2 分钟
最后更新于 8 个月前

Vivox 使用以下语音转文本听录方法。

启用或禁用听录

IVivoxService.SpeechToTextEnableTranscription

await VivoxService.Instance.SpeechToTextEnableTranscription( _channelName);
使用此方法启用频道内的语音转文本听录功能。此方法采用以下参数:
ChannelName
:要启用听录的频道的名称。

IVivoxService.SpeechToTextDisableTranscription

await VivoxService.Instance.SpeechToTextDisableTranscription( _channelName);
使用此方法禁用频道内的语音转文本听录功能。此方法采用以下参数:
ChannelName
:要禁用听录的频道的名称。

IVivoxService.IsSpeechToTextEnabled

bool isSpeechToTextEnabled = VivoxService.Instance.IsSpeechToTextEnabled(_channelName);
使用此方法检查在频道内启用还是禁用了听录。此方法采用以下参数:
ChannelName
:要检查是否启用了听录的频道的名称。

听录通知

IVivoxService.SpeechToTextMessageReceived

VivoxService.Instance.SpeechToTextMessageReceived += OnSpeechTotextMessageAdded;VivoxService.Instance.SpeechToTextMessageReceived -= OnSpeechTotextMessageAdded;private void OnSpeechTotextMessageReceived(VivoxMessage message){ // Add your code here. “message” is the new transcribed message // added to the queue.}
将此事件处理程序绑定到某个方法以便在添加听录消息时接收通知,也可取消绑定。

设置听录语言

LoginOptions.SpeechToTextLanguages

loginOptions = loginOptions ?? new LoginOptions();loginOptions.SpeechToTextLanguages = new List<string>{"en", "es", "fr"};
这是用作音频听录提示的语言列表。默认值为空数组,意味着为
en
。可以按偏好顺序指定最多三种口头语言,用于告知所有用户在听录频道中的听录。IETF 语言标签字符串未进行验证,但是应符合 BCP47(RFC Editor)。

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

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

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

  • 在本页上
    • 启用或禁用听录

      • IVivoxService.SpeechToTextEnableTranscription

      • IVivoxService.SpeechToTextDisableTranscription

      • IVivoxService.IsSpeechToTextEnabled

    • 听录通知

      • IVivoxService.SpeechToTextMessageReceived

    • 设置听录语言

      • LoginOptions.SpeechToTextLanguages


报告此页面的问题