Skip to content

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()?

ts
optional close(): void;

Returns

void


encode()

ts
encode(pcm): 
  | Buffer<ArrayBufferLike>[]
| Promise<Buffer<ArrayBufferLike>[]>;

Parameters

pcm

Buffer

Returns

| Buffer<ArrayBufferLike>[] | Promise<Buffer<ArrayBufferLike>[]>


flush()?

ts
optional flush(): 
  | Buffer<ArrayBufferLike>[]
| Promise<Buffer<ArrayBufferLike>[]>;

Returns

| Buffer<ArrayBufferLike>[] | Promise<Buffer<ArrayBufferLike>[]>

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations or eufy. "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.