There are two methods for muting a user’s microphone:
AudioInputDevices
or
SetTransmissionMode()
. Each method is beneficial for different scenarios, which are detailed in the following sections.
AudioInputDevices
Use
AudioInputDevices
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.
Note
Unless you need to manage which channels a user can speak into, it's recommended that you use this method for consistency purposes.
The following code displays an example of how to use
If you are transmitting to a channel, then you must transmit to either all channels or to only one channel. For example, if you are joined to channels A, B, and C, you cannot transmit to A and B but not to C.
Transmit to all channels
Use
TransmissionMode::All
when you want to create a realistic environment.For 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
TransmissionMode::All
, 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.
to determine which channel the player is talking into.For example, a player might be in two squad chats, and they can listen to both channels simultaneously. By using
Transmission::Single
, the player can speak into one channel at a time.