StringOrAudioSinkInfo Struct
The (DOMString or AudioSinkInfo) union of the audio output device of an AudioContext (https://webaudio.github.io/web-audio-api/#dom-audiocontext-sinkid): the identifier of a device (the empty string for the default device), or the information of a sink without device.
public readonly struct StringOrAudioSinkInfo : IEquatable<StringOrAudioSinkInfo>- Implements
Properties
| Name | Description |
|---|---|
| DeviceId | Gets the identifier of the device when the value is a string, otherwise null. |
| Info | Gets the information of the sink when the value is an AudioSinkInfo, otherwise null. |
| Value | Gets the value: a String or an AudioSinkInfo. |
DeviceId
AudioContextUnions.csGets the information of the sink when the value is an AudioSinkInfo, otherwise null.
public AudioSinkInfo? Info { get; }Property value
Methods
| Name | Description |
|---|---|
| Equals(StringOrAudioSinkInfo) | 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. |
| FromAudioSinkInfo(AudioSinkInfo) | Creates the union from the information of a sink. |
| FromString(string) | Creates the union from the identifier of a device. |
| GetHashCode() | Returns the hash code for this instance. |
Equals overloads
Equals(StringOrAudioSinkInfo)
AudioContextUnions.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(StringOrAudioSinkInfo other)Parameters
otherStringOrAudioSinkInfo- 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.csFromAudioSinkInfo(AudioSinkInfo)
AudioContextUnions.csCreates the union from the information of a sink.
public static StringOrAudioSinkInfo FromAudioSinkInfo(AudioSinkInfo value)FromString(string)
AudioContextUnions.csCreates the union from the identifier of a device.
public static StringOrAudioSinkInfo FromString(string value)GetHashCode()
AudioContextUnions.csOperators
| Name | Description |
|---|---|
| operator ==(StringOrAudioSinkInfo, StringOrAudioSinkInfo) | Returns whether the two unions hold the same value. |
| implicit operator StringOrAudioSinkInfo(AudioSinkInfo) | Converts the information of a sink to the union. |
| implicit operator StringOrAudioSinkInfo(string) | Converts the identifier of a device to the union. |
| operator !=(StringOrAudioSinkInfo, StringOrAudioSinkInfo) | Returns whether the two unions hold different values. |
operator ==(StringOrAudioSinkInfo, StringOrAudioSinkInfo)
AudioContextUnions.csReturns whether the two unions hold the same value.
public static bool operator ==(StringOrAudioSinkInfo left, StringOrAudioSinkInfo right)op_Implicit overloads
implicit operator StringOrAudioSinkInfo(AudioSinkInfo)
AudioContextUnions.csConverts the information of a sink to the union.
public static implicit operator StringOrAudioSinkInfo(AudioSinkInfo value)implicit operator StringOrAudioSinkInfo(string)
AudioContextUnions.csConverts the identifier of a device to the union.
public static implicit operator StringOrAudioSinkInfo(string value)operator !=(StringOrAudioSinkInfo, StringOrAudioSinkInfo)
AudioContextUnions.csReturns whether the two unions hold different values.
public static bool operator !=(StringOrAudioSinkInfo left, StringOrAudioSinkInfo right)