文档

​
​

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
      • Automatic connection recovery
      • Muting
        • Mute a user's microphone
        • Mute other users for a specific user
      • Block functions
    • Device management
    • Audio management
    • Mobile development
    • Text-to-speech
    • Speech-to-text
    • Real-time recording
    • Server-side-recording
    • Troubleshooting
  • Tutorials
  • Reference
  1. Vivox Unity SDK 文档
  2. Vivox Unity 开发者指南

使其他用户对特定用户静音

How to mute other users for a specific player.
阅读时间2 分钟
最后更新于 8 个月前

可以使用本地静音使其他用户对特定用户静音。
VivoxParticipant.MutePlayerLocally
函数可阻止用户听到已静音用户,但是频道中的其他用户可继续听到已静音用户。
VivoxParticipant.UnmutePlayerLocally
可用于让用户再次听到已静音用户。
例如,频道中有 Cynthia、Fernando 和 Wang 三人。Fernando 不希望听到 Wang 的音频。使用本地静音可以允许 Fernando 停止听到 Wang 的音频。但是,Cynthia 可继续听到 Wang,而 Wang 可继续听到 Cynthia 和 Fernando。
因为是 VivoxParticipant 函数,所以最好采用一些方法来处理每个 VivoxParticipant 的单独 UI 表示,从而令所有人都拥有各自的静音按钮(如 Chat Channel Sample 和参与者管理页面所示)。
或者,以下示例展示了使用
VivoxServices.Instance.ActiveChannels
字典在特定频道中查找特定参与者并对其进行静音/取消静音(使用参与者的 PlayerId 和频道的 ChannelName):
void MutePlayerLocally(string PlayerId, string ChannelName){ VivoxService.Instance.ActiveChannels[ChannelName].Where(participant => participant.PlayerId == PlayerId).First().MutePlayerLocally();}void UnmutePlayerLocally(string PlayerId, string ChannelName){ VivoxService.Instance.ActiveChannels[ChannelName].Where(participant => participant.PlayerId == PlayerId).First().UnmutePlayerLocally();}
注意
要更新 UI 元素以指示某个用户已静音的用户,则需要等到从 Vivox SDK 收到事件,以确认其他用户已静音。您可以在 Chat Channel Sample 和参与者管理页面中找到处理此事件并将其实现到 UI 中的示例。

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

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

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


    报告此页面的问题