Back to Content

RTCInboundRtpStreamStats: totalSamplesDuration property

files/en-us/web/api/rtcinboundrtpstreamstats/totalsamplesduration/index.md

latest782 B
Original Source

{{APIRef("WebRTC")}}

The totalSamplesDuration property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary indicates the total duration of all audio samples that have been received. In other words, the current duration of the track.

This can be used with {{domxref("RTCInboundRtpStreamStats/totalAudioEnergy","totalAudioEnergy")}} to compute an average audio level over different intervals.

[!NOTE] The value is undefined for video streams.

Value

A positive number, in seconds.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("RTCAudioSourceStats.totalSamplesDuration")}} for the audio duration of sent samples.
  • {{domxref("RTCInboundRtpStreamStats/totalSamplesReceived","totalSamplesReceived")}}