RemoteParticipant
Remarks
On the audio side, a remote participant acts as an AudioObject and can be freely
positioned in the Space. It also has the same audio settings as an AudioObject.
Depending on the AudioConnectionMode, the remote participant's audio stream will be
connected to the AudioListener either automatically or manually. When connected, the
remote participant's audio stream will be spatialized and rendered in the Space.A remote participant emits useful events that can be used to update the UI or to trigger
other actions. For example, the ParticipantEvent.AudioConnected event will be emitted
when the remote participant's audio stream is connected to the AudioListener.
Properties
audioLevel
Audio level of the remote participant's microphone.
Remarks
This level will be automatically updated if setAnalyseAudioLevel has been enabled.Type
number
audioTracks
A map of the remote participant's audio tracks.
identity
Participant's assigned identity (retrieved from the JWT token).
Type
string
isSpeaking
True if the participant is currently speaking
Type
boolean
isSpeakingLevel
The current audio level estimate of a speaker between 0 and 1.0, 1 being loudest,
0 being softest.
Remarks
This member is only updated when the order of loudest speakers changes.Type
number
lastSpokeAt
optional
Date when participant last spoke
Date when participant last spoke
Type
Date
metadata
optional
Participant's metadata.
Participant's metadata.
Type
string
name
optional
Participant's assigned display name (retrieved from the JWT token).
Participant's assigned display name (retrieved from the JWT token).
Type
string
permissions
optional
Participant's permissions.
Participant's permissions.
Type
ParticipantPermission
sid
Server assigned unique id
Type
string
tracks
A map of all the remote participant's tracks.
videoTracks
A map of the remote participant's video tracks.
Accessors
connectionQuality
Returns the current connection quality of the participant.
Type
ConnectionQuality
isCameraEnabled
True if the participant has enabled their camera.
Type
boolean
isLocal
Returns true if this instance is the local participant.
Type
boolean
isMicrophoneEnabled
True if the participant has enabled their microphone.
Type
boolean
isScreenShareEnabled
True if the participant is currently sharing their screen.
Type
boolean
joinedAt
Date when the participant joined the room.
Type
undefined
| Date
Methods
getAudioConnectionMode
Returns the audio connection mode of the participant.
Signature
getAudioConnectionMode()
Returns
AudioConnectionMode
getDirectPathGainDecibels
Returns the currently set direct-path gain in decibels.
Signature
getDirectPathGainDecibels()
Returns
number
The current direct-path gain in decibels.💡
The effective direct-path gain will be the product of this value and the
distance-dependent value of this object's distance modyel.
getDirectPathGainLinear
Returns the currently set direct-path gain as a linear value.
Signature
getDirectPathGainLinear()
Returns
number
The current linear direct-path gain.💡
The effective direct-path gain will be the product of this value and the
distance-dependent value of this object's distance model.
getDistanceModel
getGainDecibels
Returns the currently set gain in decibels.
Signature
getGainDecibels()
Returns
number
The current gain in decibels.getGainLinear
Returns the currently set gain as a linear value.
Signature
getGainLinear()
Returns
number
The current linear gain.getOcclusion
Returns the occlusion setting of the participant.
Signature
getOcclusion()
Returns
number
getPosition
getPositionMode
getRenderingMode
getReverbDistanceModel
Returns the distance model for the reverb path.
Signature
getReverbDistanceModel()
getReverbSendDecibels
Returns the currently set reverb gain in decibels.
Signature
getReverbSendDecibels()
Returns
number
The current reverb send gain in decibels.getReverbSendLinear
Returns the currently set reverb send gain as a linear value.
Signature
getReverbSendLinear()
Returns
number
The current linear reverb send gain.getTracks
Returns a list of all tracks published by the participant.
Signature
getTracks()
Returns
TrackPublication[]
hasSubscribedAudioTracks
Returns true if the participant has subscribed audio tracks available.
Signature
hasSubscribedAudioTracks()
Returns
boolean
isAudioConnected
Returns true if the participant is connected to the audio listener.
Signature
isAudioConnected()
Returns
boolean
setAnalyseAudioLevel
Starts or stops the RMS analyser for the participant's microphone track.
Signature
setAnalyseAudioLevel(shouldAnalyse: boolean)
Name | Type | Description |
---|---|---|
shouldAnalyse | boolean | whether to start or stop the analyser |
Returns
void
Remarks
When enabled, the audioLevel member will be updated with the current RMS value of the
microphone track. The value will be updated 10 times per second.setAudioConnectionMode
Sets the audio connection mode of the participant.
Signature
setAudioConnectionMode(mode: AudioConnectionMode)
Name | Type | Description |
---|---|---|
mode | AudioConnectionMode | the audio connection mode to set |
Returns
void
setDirectPathGainDecibels
Sets the direct-path gain in decibels.
Signature
setDirectPathGainDecibels(gainInDecibels: number)
Name | Type | Description |
---|---|---|
gainInDecibels | number |
Returns
void
💡
The effective direct-path gain will be the product of this value and the
distance-dependent value of this object's distance model.
setDirectPathGainLinear
Sets the direct-path gain from a linear value.
Signature
setDirectPathGainLinear(gain: number)
Name | Type | Description |
---|---|---|
gain | number | The linear gain to apply to this object's direct path. |
Returns
void
💡
The effective direct-path gain will be the product of this value and the
distance-dependent value of this object's distance model.
setDistanceModel
Sets the distance model for the direct-path.
Signature
setDistanceModel(distanceModel: DistanceModel)
Name | Type | Description |
---|---|---|
distanceModel | DistanceModel | the distance model to set |
Returns
void
setGainDecibels
Sets the overall gain of the participant in decibels.
Signature
setGainDecibels(gainInDecibels: number)
Name | Type | Description |
---|---|---|
gainInDecibels | number | the overall gain in decibels |
Returns
void
setGainLinear
Sets the overall gain from a linear value.
Signature
setGainLinear(gain: number)
Name | Type | Description |
---|---|---|
gain | number | The linear gain to apply to this audio object. |
Returns
void
setOcclusion
Sets the occlusion setting of the participant.
Signature
setOcclusion(occlusion: number)
Name | Type | Description |
---|---|---|
occlusion | number | the occlusion value to set, between 0 and 1 |
Returns
void
Remarks
An occlusion value of 0 means no occlusion, i.e. the participant is not occluded by any object.
An occlusion value of 1 means full occlusion, i.e. the participant is fully occluded.setPosition
Sets the position of the participant.
Signature
setPosition(x: number, y: number, z: number)
Name | Type | Description |
---|---|---|
x | number | x-coordinate |
y | number | y-coordinate |
z | number | z-coordinate |
Returns
void
setPositionMode
Sets the PositionMode of the participant.
Signature
setPositionMode(mode: PositionMode)
Name | Type | Description |
---|---|---|
mode | PositionMode | the position mode to set |
Returns
void
💡
The position mode determines how the position of the participant is interpreted for
the audio rendering.
💡
The default mode of a RemoteParticipant is PositionMode.SceneLocked.
setRenderingMode
Sets the rendering mode of the participant.
Signature
setRenderingMode(renderingMode: RenderingMode)
Name | Type | Description |
---|---|---|
renderingMode | RenderingMode | the rendering mode to set |
Returns
void
setReverbDistanceModel
Sets the distance model for the reverb path.
Signature
setReverbDistanceModel(reverbDistanceModel: undefined | DistanceModel)
Name | Type | Description |
---|---|---|
reverbDistanceModel | undefined | DistanceModel | the distance model to set |
Returns
void
💡
Passing null will call unsetReverbDistanceModel and unset the distance model.
setReverbSendDecibels
Sets the gain in decibels that is applied to the reverb send.
Signature
setReverbSendDecibels(gainInDecibels: number)
Name | Type | Description |
---|---|---|
gainInDecibels | number |
Returns
void
setReverbSendLinear
Sets the linear gain that is applied to the reverb send.
Signature
setReverbSendLinear(gain: number)
Name | Type | Description |
---|---|---|
gain | number | The linear gain to apply to the reverb send. |
Returns
void
unsetReverbDistanceModel
Unsets the distance model for the reverb path.
Signature
unsetReverbDistanceModel()
Returns
void
Remarks
This will make the reverb send path independent of the participant's distance to the listener.