Class AudioDecoder
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The AudioDecoder interface of the 'WebCodecs API' decodes chunks of audio.
[Value("AudioDecoder")]
public class AudioDecoder : EventTarget
- Inheritance
-
AudioDecoder
- Inherited Members
Remarks
Constructors
AudioDecoder()
public AudioDecoder()
AudioDecoder(AudioDecoderInit)
The AudioDecoder() constructor creates a new AudioDecoder object with the provided init.output callback assigned as the output callback, the provided init.error callback as the error callback, and the State set to "unconfigured".
public AudioDecoder(AudioDecoderInit init)
Parameters
initAudioDecoderInit
Remarks
Properties
DecodeQueueSize
The decodeQueueSize read-only property of the AudioDecoder interface returns the number of pending decode requests in the queue.
[Value("decodeQueueSize")]
public ulong DecodeQueueSize { get; }
Property Value
- ulong
An integer containing the number of requests.
Remarks
Ondequeue
[Value("ondequeue")]
public EventHandlerNonNull Ondequeue { get; set; }
Property Value
State
The state read-only property of the AudioDecoder interface returns the current state of the underlying codec.
[Value("state")]
public CodecState State { get; }
Property Value
- CodecState
A string containing one of the following values:
Remarks
Methods
Close()
The close() method of the AudioDecoder interface ends all pending work and releases system resources.
[Value("close")]
public GlobalObject.Undefined Close()
Returns
Remarks
Configure(AudioDecoderConfig)
The configure() method of the AudioDecoder interface enqueues a control message to configure the audio decoder for decoding chunks.
[Value("configure")]
public GlobalObject.Undefined Configure(AudioDecoderConfig config)
Parameters
configAudioDecoderConfig
Returns
Remarks
Decode(EncodedAudioChunk)
The decode() method of the AudioDecoder interface enqueues a control message to decode a given chunk of audio.
[Value("decode")]
public GlobalObject.Undefined Decode(EncodedAudioChunk chunk)
Parameters
chunkEncodedAudioChunk
Returns
Remarks
Flush()
The flush() method of the AudioDecoder interface returns a Promise that resolves once all pending messages in the queue have been completed.
[Value("flush")]
public Task<GlobalObject.Undefined> Flush()
Returns
- Task<GlobalObject.Undefined>
A Promise that resolves with undefined.
Remarks
IsConfigSupported(AudioDecoderConfig)
The isConfigSupported() static method of the AudioDecoder interface checks if the given config is supported (that is, if AudioDecoder objects can be successfully configured with the given config).
[Value("isConfigSupported")]
public static Task<AudioDecoderSupport> IsConfigSupported(AudioDecoderConfig config)
Parameters
configAudioDecoderConfig
Returns
- Task<AudioDecoderSupport>
A Promise that resolves with an object containing the following members:
Remarks
Reset()
The reset() method of the AudioDecoder interface resets all states including configuration, control messages in the control message queue, and all pending callbacks.
[Value("reset")]
public GlobalObject.Undefined Reset()