atmoky Engage Server SDK is now available! Check out the documentation to learn more.
API Reference
Classes
RemoteParticipant

RemoteParticipant

Summary
This class represents a remote participant of a Room (in contrast to the LocalParticipant).
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.
Type
Map<string, RemoteTrackPublication>

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
Type
Date

metadata

optional
Participant's metadata.
Type
string

name

optional
Participant's assigned display name (retrieved from the JWT token).
Type
string

permissions

optional
Participant's permissions.
Type
ParticipantPermission

sid

Server assigned unique id
Type
string

tracks

A map of all the remote participant's tracks.
Type
Map<string, RemoteTrackPublication>

videoTracks

A map of the remote participant's video tracks.
Type
Map<string, RemoteTrackPublication>

Accessors

connectionQuality

Returns the current connection quality of the participant.

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()

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

Returns the distance model for the direct-path.
Signature
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

Returns the position of the participant.
Signature
getPosition()
Returns
Vector3D

getPositionMode

Returns the PositionMode of the participant.
Signature
getPositionMode()
Returns
PositionMode

getRenderingMode

Returns the rendering mode of the participant.
Signature
getRenderingMode()

getReverbDistanceModel

Returns the distance model for the reverb path.
Signature
getReverbDistanceModel()
Returns
undefined | DistanceModel the distance model for the reverb path or null if no mode is set

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()

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)
NameTypeDescription
shouldAnalysebooleanwhether 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)
NameTypeDescription
modeAudioConnectionModethe audio connection mode to set
Returns
void

setDirectPathGainDecibels

Sets the direct-path gain in decibels.
Signature
setDirectPathGainDecibels(gainInDecibels: number)
NameTypeDescription
gainInDecibelsnumber
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)
NameTypeDescription
gainnumberThe 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)
NameTypeDescription
distanceModelDistanceModelthe distance model to set
Returns
void

setGainDecibels

Sets the overall gain of the participant in decibels.
Signature
setGainDecibels(gainInDecibels: number)
NameTypeDescription
gainInDecibelsnumberthe overall gain in decibels
Returns
void

setGainLinear

Sets the overall gain from a linear value.
Signature
setGainLinear(gain: number)
NameTypeDescription
gainnumberThe linear gain to apply to this audio object.
Returns
void

setOcclusion

Sets the occlusion setting of the participant.
Signature
setOcclusion(occlusion: number)
NameTypeDescription
occlusionnumberthe 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)
NameTypeDescription
xnumberx-coordinate
ynumbery-coordinate
znumberz-coordinate
Returns
void

setPositionMode

Sets the PositionMode of the participant.
Signature
setPositionMode(mode: PositionMode)
NameTypeDescription
modePositionModethe 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)
NameTypeDescription
renderingModeRenderingModethe rendering mode to set
Returns
void

setReverbDistanceModel

Sets the distance model for the reverb path.
Signature
setReverbDistanceModel(reverbDistanceModel: undefined | DistanceModel)
NameTypeDescription
reverbDistanceModelundefined | DistanceModelthe 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)
NameTypeDescription
gainInDecibelsnumber
Returns
void

setReverbSendLinear

Sets the linear gain that is applied to the reverb send.
Signature
setReverbSendLinear(gain: number)
NameTypeDescription
gainnumberThe 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.

atmoky Logo

© 2024 atmoky, GmbH.
All rights reserved.

We use cookies to measure and improve your browsing experience, and serve personalized ads or content.