Class VivoxParticipant
Representation of a player that is in a Vivox voice and/or text channel.
Inherited Members
Namespace: Unity.Services.Vivox
Assembly: Unity.Services.Vivox.dll
Syntax
public sealed class VivoxParticipant
Properties
AudioEnergy
The AudioEnergy of the participant. This can be used to create a voice activity meter for participants in a channel.
Declaration
public double AudioEnergy { get; }
Property Value
Type | Description |
---|---|
double |
ChannelName
The unique identifier of the channel that this participant is associated with.
Declaration
public string ChannelName { get; }
Property Value
Type | Description |
---|---|
string |
ChannelURI
The universal resource identifier of the channel this participant is associated with.
Declaration
public string ChannelURI { get; }
Property Value
Type | Description |
---|---|
string |
DisplayName
The DisplayName of the participant.
Declaration
public string DisplayName { get; }
Property Value
Type | Description |
---|---|
string |
IsMuted
Whether or not this participant is muted.
Declaration
public bool IsMuted { get; }
Property Value
Type | Description |
---|---|
bool |
IsSelf
Whether or not this participant is the logged in user.
Declaration
public bool IsSelf { get; }
Property Value
Type | Description |
---|---|
bool |
LocalVolume
The volume of a participant only for the local user in a given channel.
Declaration
public int LocalVolume { get; }
Property Value
Type | Description |
---|---|
int |
ParticipantTapAudioSource
The AudioSource component of a VivoxParticipantTap gameobject if one has been created. This will be null if there is no active VivoxParticipantTap associated with this participant object.
Declaration
public AudioSource ParticipantTapAudioSource { get; }
Property Value
Type | Description |
---|---|
AudioSource |
PlayerId
The PlayerId and unique identifier of a Vivox channel participant. This will be either a Unity Authentication Service PlayerId if the Authentication package is in use, or a unique GUID assigned by Vivox during the account creation process.
Declaration
public string PlayerId { get; }
Property Value
Type | Description |
---|---|
string |
SpeechDetected
Whether or not the AudioEnergy has surpassed the threshold to be considered speech.
Declaration
public bool SpeechDetected { get; }
Property Value
Type | Description |
---|---|
bool |
URI
The Vivox universal resource identifier of this participant.
Declaration
public string URI { get; }
Property Value
Type | Description |
---|---|
string |
Methods
CreateVivoxParticipantTap(string, bool)
Creates a GameObject containing the VivoxParticipantTap and AudioSource for this VivoxParticipant
Declaration
public GameObject CreateVivoxParticipantTap(string gameObjectName = "", bool silenceInChannelAudioMix = true)
Parameters
Type | Name | Description |
---|---|---|
string | gameObjectName | Optional name to give to the created GameObject |
bool | silenceInChannelAudioMix | Whether to mute this Participant in the Channel Audio Mix output (defaults to true) |
Returns
Type | Description |
---|---|
GameObject | The built GameObject with the VivoxParticipantTap. This will return null if the creation fails for any reason. |
DestroyVivoxParticipantTap()
Destroys the GameObject containing the VivoxParticipantTap for this VivoxParticipant and sets the AudioSource to null
Declaration
public void DestroyVivoxParticipantTap()
MutePlayerLocally()
Sets this participant as muted for the local user only in the channel associated with this participant. In order to mute this player across multiple channels you will need to iterate over ActiveChannels and leverage this method on the additional VivoxParticipant objects that match this instance's PlayerId.
Declaration
public void MutePlayerLocally()
SetLocalVolume(int)
Sets the volume of a participant for the local user only in the channel associated with this participant. In order to adjust the volume of this player across multiple channels you will need to iterate over ActiveChannels. Similar participants will have a matching PlayerId as the current VivoxParticipant. This only affects the audio that is heard locally, and does not change the audio that is heard by any of the other participants in a channel. Volume value is clamped between -50 and 50 with a default of 0.
Declaration
public void SetLocalVolume(int volume)
Parameters
Type | Name | Description |
---|---|---|
int | volume | The value to set the participant to for the local user - clamped between -50 and 50 with a default of 0 |
UnmutePlayerLocally()
Sets this participant as unmuted for the local user only in the channel associated with this participant. In order to unmute this player across multiple channels you will need to iterate over ActiveChannels and leverage this method on the additional VivoxParticipant objects that match this instance's PlayerId.
Declaration
public void UnmutePlayerLocally()
Events
ParticipantAudioEnergyChanged
An event that fires if the Participants audio energy changes.
Declaration
public event Action ParticipantAudioEnergyChanged
Event Type
Type | Description |
---|---|
Action |
ParticipantMuteStateChanged
An event that fires if the mute state of the participant changes.
Declaration
public event Action ParticipantMuteStateChanged
Event Type
Type | Description |
---|---|
Action |
ParticipantSpeechDetected
An event that fires if the Participant's speech detected status changes.
Declaration
public event Action ParticipantSpeechDetected
Event Type
Type | Description |
---|---|
Action |