AudioPlaybackStats Class

The statistics of the playback of an AudioContext (https://webaudio.github.io/web-audio-api/#AudioPlaybackStats). As there is no audio device, the played duration is the time during which the context is running, and the underruns are the times skipped by a late rendering.

public sealed class AudioPlaybackStats

Remarks

The values do not change during a task or a microtask of the scripts: they are read once, until the next microtask checkpoint.

See also

Properties

NameDescription
AverageLatencyGets the average latency in seconds.
MaximumLatencyGets the maximum latency in seconds.
MinimumLatencyGets the minimum latency in seconds.
TotalDurationGets the duration in seconds of the playback.
UnderrunDurationGets the duration in seconds of the underruns.
UnderrunEventsGets the number of underruns.

AverageLatency

AudioContext.cs

Gets the average latency in seconds.

public double AverageLatency { get; }

MaximumLatency

AudioContext.cs

Gets the maximum latency in seconds.

public double MaximumLatency { get; }

MinimumLatency

AudioContext.cs

Gets the minimum latency in seconds.

public double MinimumLatency { get; }

TotalDuration

AudioContext.cs

Gets the duration in seconds of the playback.

public double TotalDuration { get; }

UnderrunDuration

AudioContext.cs

Gets the duration in seconds of the underruns.

public double UnderrunDuration { get; }

UnderrunEvents

AudioContext.cs

Gets the number of underruns.

public uint UnderrunEvents { get; }

Methods

NameDescription
ResetLatency()Restarts the statistics of the latency: the minimum and the maximum become the average latency.

ResetLatency()

AudioContext.cs

Restarts the statistics of the latency: the minimum and the maximum become the average latency.

public void ResetLatency()