AudioContextLatencyHint Struct

The (AudioContextLatencyCategory or double) union of the latency hint of an AudioContext (https://webaudio.github.io/web-audio-api/#dom-audiocontextoptions-latencyhint): a category, or a latency in seconds.

public readonly struct AudioContextLatencyHint : IEquatable<AudioContextLatencyHint>
Implements

Properties

NameDescription
CategoryGets the category when the value is a category, otherwise null.
SecondsGets the latency in seconds when the value is a number, otherwise null.
ValueGets the value: an AudioContextLatencyCategory or a Double.

Gets the category when the value is a category, otherwise null.

public AudioContextLatencyCategory? Category { get; }

Gets the latency in seconds when the value is a number, otherwise null.

public double? Seconds { get; }

Property value

double?

Gets the value: an AudioContextLatencyCategory or a Double.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(AudioContextLatencyHint)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromAudioContextLatencyCategory(AudioContextLatencyCategory)Creates a union value from a category.
FromDouble(double)Creates a union value from a latency in seconds.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(AudioContextLatencyHint)

AudioContextUnions.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(AudioContextLatencyHint other)
Parameters
other AudioContextLatencyHint
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

AudioContextUnions.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromAudioContextLatencyCategory(AudioContextLatencyCategory)

AudioContextUnions.cs

Creates a union value from a category.

public static AudioContextLatencyHint FromAudioContextLatencyCategory(AudioContextLatencyCategory value)

FromDouble(double)

AudioContextUnions.cs

Creates a union value from a latency in seconds.

public static AudioContextLatencyHint FromDouble(double value)

Parameters

value double

Returns

AudioContextLatencyHint

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Operators

NameDescription
operator ==(AudioContextLatencyHint, AudioContextLatencyHint)Returns whether the two values are equal.
implicit operator AudioContextLatencyHint(AudioContextLatencyCategory)Creates a union value from a category.
implicit operator AudioContextLatencyHint(double)Creates a union value from a latency in seconds.
operator !=(AudioContextLatencyHint, AudioContextLatencyHint)Returns whether the two values are different.

operator ==(AudioContextLatencyHint, AudioContextLatencyHint)

AudioContextUnions.cs

Returns whether the two values are equal.

public static bool operator ==(AudioContextLatencyHint left, AudioContextLatencyHint right)

op_Implicit overloads

implicit operator AudioContextLatencyHint(AudioContextLatencyCategory)

AudioContextUnions.cs

Creates a union value from a category.

public static implicit operator AudioContextLatencyHint(AudioContextLatencyCategory value)

implicit operator AudioContextLatencyHint(double)

AudioContextUnions.cs

Creates a union value from a latency in seconds.

public static implicit operator AudioContextLatencyHint(double value)
Parameters
value double
Returns

AudioContextLatencyHint

operator !=(AudioContextLatencyHint, AudioContextLatencyHint)

AudioContextUnions.cs

Returns whether the two values are different.

public static bool operator !=(AudioContextLatencyHint left, AudioContextLatencyHint right)