W3cubDocs

/Web APIs

RTCInboundRtpStreamStats: totalAudioEnergy property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨October 2022⁩.

The totalAudioEnergy property of the RTCInboundRtpStreamStats dictionary represents the total audio energy of a received audio track over the lifetime of this stats object.

The total energy across a particular duration can be determined by subtracting the value of this property returned by two different getStats() calls.

Note: The value is undefined for video streams.

Value

A number produced by summing the energy of every sample over the lifetime of this stats object.

The energy of each sample is calculated by dividing the sample's value by the highest-intensity encodable value, squaring the result, and then multiplying by the duration of the sample in seconds. This is shown as an equation below:

duration×(sample_levelmax_level)2duration \times⁢ \left(\left(\right. \frac{sample{\_}level}{max{\_}level} \left.\right)\right)^{2}

Note that if multiple audio channels are used, the audio energy of a sample refers to the highest energy of any channel.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
totalAudioEnergy 86 86 106 72 14.1 86 106 61 14.5 14.0 86 14.5

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCInboundRtpStreamStats/totalAudioEnergy