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