useAudioLevelDeprecated
useAudioLevel
Deprecated
useAudioLevel(params) : void
useAudioLevel
is deprecated. Use useAudioLevelObserver
instead.
TheuseAudioLevel
hook takes aMediaStreamTrack
(for example, a call participant's audio track). 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 |
---|---|---|---|
mediaTrack | ✓ | MediaStreamTrack | The MediaStreamTrack to test |
onVolumeChange | ✓ | Function | A callback reference to run when the track's volume level changes |