Skip to content

OpusCodec

Defined in: packages/voice/src/opus.ts:5

One 48 kHz stereo Opus encoder and decoder. Call destroy() when done.

readonly library: string

Defined in: packages/voice/src/opus.ts:7

The library behind it: "libopus" (the system’s, through bun:ffi) or "opusscript" (WebAssembly).

decode(packet): Uint8Array

Defined in: packages/voice/src/opus.ts:11

Decodes one Opus packet to s16le PCM.

Uint8Array

Uint8Array


destroy(): void

Defined in: packages/voice/src/opus.ts:12

void


encode(pcm): Uint8Array

Defined in: packages/voice/src/opus.ts:9

Encodes one 20 ms frame of s16le PCM (3,840 bytes).

Uint8Array

Uint8Array