Mute a user's microphone
How to mute the local player microphone.
読み終わるまでの所要時間 1 分最終更新 7ヶ月前
There are two methods for muting a user’s microphone: or . Each method is beneficial for different scenarios, which are detailed in the following sections.
AudioInputDevicesSetTransmissionMode()AudioInputDevices
Use if you want a user to transmit to one channel at a time, or if you want to mute the user's microphone in all channels. This method mutes a user’s microphone across the client.
AudioInputDevicesThe following code displays an example of how to use .
AudioInputDevices//mutedVivoxVoiceClient->AudioInputDevices().SetMuted(true)//unmutedVivoxVoiceClient->AudioInputDevices().SetMuted(false)
SetTransmissionMode()
Use when you are managing multiple channels.
SetTransmissionMode()You can transmit to channels by using one of the following methods:
Transmit to all channels
Use when you want to create a realistic environment.
TransmissionMode::AllFor example, if a player is talking into a two-way radio, a developer might want other players to also hear the player in the 3D space. By using , when the player speaks, both the players in the two-way radio channel and the players nearby in the world chat can hear the player.
TransmissionMode::AllLoginSession.SetTransmissionMode(TransmissionMode::All)
Transmit to one channel
Use to determine which channel the player is talking into.
Transmission::SingleFor example, a player might be in two squad chats, and they can listen to both channels simultaneously. By using , the player can speak into one channel at a time.
Transmission::SingleLoginSession.SetTransmissionMode(TransmissionMode::Single, ChannelId singleChannel)
Transmit to no channels
Use to prevent a player from being heard in any channels.
Transmission::NoneLoginSession.SetTransmissionMode(TransmissionMode::None)