W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > May 2017

[webrtc-stats] Need some way of getting an averaged audio level stat

From: Taylor Brandstetter via GitHub <sysbot+gh@w3.org>
Date: Thu, 11 May 2017 17:43:14 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issues.opened-228069545-1494524593-sysbot+gh@w3.org>
taylor-b has just created a new issue for https://github.com/w3c/webrtc-stats:

== Need some way of getting an averaged audio level stat ==
`RTCMediaStreamTrackStats.audioLevel` only represents the level of the last encoded/decoded chunk of audio, or so I assume (may need to be clarified, see https://github.com/w3c/webrtc-stats/issues/193). So it's not useful for all use cases. If `getStats` is called at the wrong time, it may see an `audioLevel` of 0, just because it happened to be called during a blip of silence. The application may really be more interested in an average level over a certain time period.

The guideline for "averaged" stats is to provide "sum" and "count" fields, such that the application can compute an average over any time interval by dividing "sum/count" for that interval. This is a bit more complicated for audioLevel, since it's based on the root mean square (RMS) of audio samples. So we would have to do something like provide a sum of "mean square X sample duration" (say, "totalAudioEnergy"), and a "totalDuration", and let the application compute the average audio level as "sqrt(totalAudioEnergy)/totalDuration".

Please view or discuss this issue at https://github.com/w3c/webrtc-stats/issues/220 using your GitHub account
Received on Thursday, 11 May 2017 17:43:20 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:40 UTC