Skip to content

@mega-yfue/eufy-sdk / AacEncoder

Interface: AacEncoder ​

An encoder that turns raw PCM into AAC-LC frames, supplied by the CALLER. The SDK ships none: an aac-lc speaker plays 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. It is unnecessary where the audio is already AAC — see TalkbackHandle. A camera whose speaker plays aac-eld refuses an encoder: a talkback opened with one is rejected before the speaker path opens.

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
close?(): void;

Returns ​

void


encode() ​

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

Parameters ​

pcm ​

Buffer

Returns ​

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


flush()? ​

ts
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, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.