useAudioLevelObserver
useAudioLevelObserver(params) : void
The useAudioLevelObserver
hook takes a sessionId
. The second parameter, onVolumeChange
, is a callback function,
which runs when the track's volume level changes. With this callback, you can respond to the track's volume changes in whichever way you want.
Params
Parameter | Required | Type | Description |
---|---|---|---|
sessionId | ✓ | string | The participant's sessionId for which audio level should be observed |
onVolumeChange | ✓ | Function | A callback reference to run when the track's volume level changes |
onError | Function | A callback reference to run when local audio level observer is not available in the current browser. | |
interval | number | The interval in milliseconds at which the volume level is checked (default: 200, minimum: 100) |