====== onVolume() ====== wrtc.onVolume() is called when [[ixnx:wrtc:js:api:wrtc:adv.volumemeter|wrtc.adv.volumeMeter()]] has sampled microphone volume. You can use this event to display current microphone volume, like a volume meter instrument. ===== Occurs ===== Each time microphone volume has been sampled. The number of [[ixnx:wrtc:js:api:wrtc:onvolume|wrtc.onVolume()]] events per second is determined by [[ixnx:wrtc:js:api:call:adv.stats_ms|call.adv.stats_ms]] ===== Arguments ===== wrtc.onVolume(arg) * arg - numeric value of current volume, 0-255. ===== Example ===== By varying the width of a div according to current volume value you get a volume meter bar. wrtc.onVolume(arg) { document.getElementById("volume").style.width = arg; } ...
===== See also ===== [[ixnx:wrtc:js:api:wrtc:adv.volumemeter|wrtc.adv.VolumeMeter()]]