/** * libopus, built by codec/opus/build.sh, without Emscripten's JS: one import, a few exports. * Takes the module's bytes, so a worklet, a page and Node all load it the same way (GRYT-1818). */ /** CELT only: the lowest delay Opus has, and the only mode that takes 2.5 ms frames. */ export declare const OPUS_RESTRICTED_LOWDELAY = 2051; export interface OpusCodec { encoder(options: { frame: number; bitrate: number; complexity?: number; channels?: 1 | 2; }): OpusEncoder; /** Decodes mono and stereo packets alike; a stereo decoder gives a mono packet on both sides. */ decoder(frame: number, channels?: 1 | 2): OpusDecoder; } export interface OpusEncoder { /** One frame of float PCM in, interleaved when stereo, one packet out. */ encode(pcm: Float32Array): Uint8Array; destroy(): void; } export interface OpusDecoder { /** A packet in, one frame out, interleaved when stereo. Null for a packet that never came: Opus fills the gap. */ decode(packet: Uint8Array | null): Float32Array; destroy(): void; } export declare function loadOpus(bytes: BufferSource): Promise;