大网数据广告活动
Web 标准与前端开发

RTCInboundRtpStreamStats: totalAudioEnergy property

· 52CE 我爱测

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

WebRTC

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:

<math display="block"> <semantics><mrow><mi>duration</mi><mo>×</mo><msup><mrow><mo>(</mo><mfrac><mi>sample_level</mi><mi>max_level</mi></mfrac><mo>)</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="TeX">duration \times⁢ \left(\left(\right. \frac{sample{_}level}{max{_}level} \left.\right)\right)^{2}</annotation></semantics> </math>

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

See also

  • RTCAudioSourceStats.totalAudioEnergy for audio energy of local tracks (that are being sent)

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。