eufy-mega / core/contracts / AacEncoder
Interface: AacEncoder
An encoder that turns raw PCM into AAC-LC frames, supplied by the CALLER. The SDK ships none: the device's audio path is fixed at AAC-LC 16 kHz mono, and every plausible encoder is either a native dependency or an external process, both of which belong to the host rather than to a protocol SDK. A caller that already holds AAC needs none of this — see TalkbackHandle.
encode receives 16-bit little-endian mono PCM at 16 kHz and returns whole ADTS frames, zero or more per call (an encoder buffers until it has a full 1024-sample block). flush drains a partial trailing block; close releases whatever the encoder holds.
Methods
close()?
optional close(): void;Returns
void
encode()
encode(pcm):
| Buffer<ArrayBufferLike>[]
| Promise<Buffer<ArrayBufferLike>[]>;Parameters
pcm
Buffer
Returns
| Buffer<ArrayBufferLike>[] | Promise<Buffer<ArrayBufferLike>[]>
flush()?
optional flush():
| Buffer<ArrayBufferLike>[]
| Promise<Buffer<ArrayBufferLike>[]>;Returns
| Buffer<ArrayBufferLike>[] | Promise<Buffer<ArrayBufferLike>[]>