Table of Contents

Class RTCAudioSourceStats

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The RTCAudioSourceStats dictionary of the WebRTC API provides statistics information about an audio track (MediaStreamTrack) that is attached to one or more senders (RTCRtpSender).

[ToObject]
public class RTCAudioSourceStats : RTCMediaSourceStats
Inheritance
RTCAudioSourceStats
Inherited Members

Remarks

These statistics can be obtained by iterating the RTCStatsReport returned by GetStats() or GetStats(MediaStreamTrack?) until you find a report with the type of media-source and a kind of audio.

NOTE

For audio information about remotely sourced tracks (that are being received), see RTCInboundRtpStreamStats.

See also on MDN

Constructors

RTCAudioSourceStats()

public RTCAudioSourceStats()

Fields

AudioLevel

NOTE
Experimental
The audioLevel property of the RTCAudioSourceStats dictionary represents the audio level of the media source.
[Value("audioLevel")]
public Number AudioLevel

Field Value

Number

A number between 0 and 1 (linear), where 1.0 represents 0 dBov (decibels relative to full scale (DBFS)), 0 represents silence, and 0.5 represents approximately 6 dB SPL change in the sound pressure level from 0 dBov.

Remarks

The level is averaged over some small implementation-dependent interval.
Users can alternatively calculate the average audio level over some arbitrary duration using the algorithm described in the RTCAudioSourceStats description.

NOTE

For audio levels of remotely sourced tracks, see AudioLevel.

See also on MDN

EchoReturnLoss

[Value("echoReturnLoss")]
public Number EchoReturnLoss

Field Value

Number

EchoReturnLossEnhancement

[Value("echoReturnLossEnhancement")]
public Number EchoReturnLossEnhancement

Field Value

Number

TotalAudioEnergy

NOTE
Experimental
The totalAudioEnergy property of the RTCAudioSourceStats dictionary represents the total audio energy of the media source over the lifetime of this stats object.
[Value("totalAudioEnergy")]
public Number TotalAudioEnergy

Field Value

Number

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:Note that if multiple audio channels are used, the audio energy of a sample refers to the highest energy of any channel.

Remarks

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

NOTE

For audio energy of remotely sourced tracks, see TotalAudioEnergy.

See also on MDN

TotalSamplesDuration

NOTE
Experimental
The totalSamplesDuration property of the RTCAudioSourceStats dictionary represents the combined duration of all samples produced by the media source over the lifetime of this stats object, in seconds.
It does not include samples dropped before reaching this media source. <!-- Dropped samples in `droppedSamplesDuration`; not implemented -->
[Value("totalSamplesDuration")]
public Number TotalSamplesDuration

Field Value

Number

A number indicating the total duration of all samples produced by this source over the lifetime this stats object, in seconds.

Remarks

This can be used with TotalAudioEnergy to compute an average audio level over different intervals.

NOTE

For audio duration of remotely sourced tracks, see TotalSamplesDuration.

See also on MDN