The Audio/Video client class
A flag to track whether the current user is actively broadcasting their microphone.
Flag to determine if we are connected to the signalling server or not. This is required for synchronization between connection and reconnection attempts.
Activate voice detection tracking for a userId on a provided MediaStream. Currently only a MediaStream is supported because MediaStreamTrack processing is not yet supported cross-browser.
The MediaStream which corresponds to that User
Optional
ms: numberA number of milliseconds which represents the voice activation volume interval
Private
_initializePrivate
_initializePrivate
_onPrivate
Periodic notification of user audio level
This function uses the audio level (in dB) of the audio stream to determine if the user is speaking or not and notifies the UI of such changes.
The User is considered speaking if they are above the decibel threshold in any of the history values. This marks them as speaking as soon as they have a high enough volume, and marks them as not speaking only after they drop below the threshold in all histories (last 4 volumes = for 200 ms).
There can be more optimal ways to do this and which uses whether the user was already considered speaking before or not, in order to eliminate short bursts of audio (coughing for example).
The audio level in decibels of the user within the last 50ms
The master Audio/Video controller instance. This is available as the singleton game.webrtc
Param: settings
The Audio/Video settings to use