/*! * Copyright (c) 2025-present, Vanilagy and contributors * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** * Decodes audio frames from encoded chunks. * * Corresponds to the WebCodecs AudioDecoder API. */ export declare class AudioDecoderPolyfill extends EventTarget { private init; private codecContext; private mutex; private frame; private packet; private _decodeQueueSize; private currentConfigId; private _keyChunkRequired; private _pendingFlushResolvers; private _state; /** * The current state of the decoder. */ get state(): CodecState; /** * The number of pending decode operations. */ get decodeQueueSize(): number; /** * Event handler called when a decode operation completes and leaves the queue. */ ondequeue: ((this: AudioDecoder, ev: Event) => unknown) | null; /** * Creates a new AudioDecoder. */ constructor(init: AudioDecoderInit); private static createCodecContext; /** * Checks if the decoder can support the given configuration. */ static isConfigSupported(config: AudioDecoderConfig): Promise; /** * Configures the decoder with the given configuration. */ configure(config: AudioDecoderConfig): void; private configureInternal; /** * Queues an encoded audio chunk to be decoded. */ decode(chunk: EncodedAudioChunk): void; private outputData; private decrementQueue; private decodeInternal; /** * Flushes all pending decode operations and waits for completion. */ flush(): Promise; private flushInternal; /** * Closes the decoder and releases all resources. */ close(): void; /** * Resets the decoder to an unconfigured state. */ reset(): void; private handleAsyncError; }