Module webcodecs_audio_decoder
WebCodecs AudioDecoder (src/page/bindings_audio_decoder.odin, native/js/runtime/web_webcodecs_audio_decoder.c). Wires to the audio decoders of src/media behind an honest isConfigSupported; a decoded block becomes an AudioData delivered through the output callback.
Exposed to: Window, Worker. Source: api/webcodecs_audio_decoder.widl.
Odin: import "wren:webcodecs".
Types
handle AudioDecoder : Object
Checked by the browser on every call (lookup_AudioDecoder).
callback AudioDecoderOutput
void AudioDecoderOutput(i32 user, u64 data)callback AudioDecoderError
void AudioDecoderError(i32 user, i32 code)Functions
AudioDecoder_create
AudioDecoder AudioDecoder_create(AudioDecoderOutput output, i32 output_user, AudioDecoderError error, i32 error_user) raisesRaises: returns an Error (see web).
Host: AudioDecoder_create :: proc(c: ^Call, output: u32, output_user: i32, error: u32, error_user: i32) -> (u64, Api_Error)
AudioDecoder_isConfigSupported
bool AudioDecoder_isConfigSupported(string codec)AudioDecoder.isConfigSupported(config.codec): honest (AAC, MP3, Opus, FLAC).
Host: AudioDecoder_isConfigSupported :: proc(c: ^Call, codec: string) -> bool
AudioDecoder_configure
void AudioDecoder_configure(AudioDecoder decoder, string codec, bytes description, u32 sample_rate, u32 channels) raisesRaises: returns an Error (see web).
Host: AudioDecoder_configure :: proc(c: ^Call, decoder: Api_AudioDecoder, codec: string, description: []u8, sample_rate: u32, channels: u32) -> Api_Error
AudioDecoder_decode
void AudioDecoder_decode(AudioDecoder decoder, bool key, i64 timestamp, i64 duration, bool has_duration, bytes data) raisesRaises: returns an Error (see web).
Host: AudioDecoder_decode :: proc(c: ^Call, decoder: Api_AudioDecoder, key: bool, timestamp: i64, duration: i64, has_duration: bool, data: []u8) -> Api_Error
AudioDecoder_flush
void AudioDecoder_flush(AudioDecoder decoder) raisesRaises: returns an Error (see web).
Host: AudioDecoder_flush :: proc(c: ^Call, decoder: Api_AudioDecoder) -> Api_Error
AudioDecoder_reset
void AudioDecoder_reset(AudioDecoder decoder)Host: AudioDecoder_reset :: proc(c: ^Call, decoder: Api_AudioDecoder)
AudioDecoder_close
void AudioDecoder_close(AudioDecoder decoder)Host: AudioDecoder_close :: proc(c: ^Call, decoder: Api_AudioDecoder)
AudioDecoder_decodeQueueSize
u32 AudioDecoder_decodeQueueSize(AudioDecoder decoder)Host: AudioDecoder_decodeQueueSize :: proc(c: ^Call, decoder: Api_AudioDecoder) -> u32
AudioDecoder_state
i32 AudioDecoder_state(AudioDecoder decoder)Host: AudioDecoder_state :: proc(c: ^Call, decoder: Api_AudioDecoder) -> i32