@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()?
close?(): void;Returns
void
encode()
encode(pcm):
| Buffer<ArrayBufferLike>[]
| Promise<Buffer<ArrayBufferLike>[]>;Parameters
pcm
Buffer
Returns
| Buffer<ArrayBufferLike>[] | Promise<Buffer<ArrayBufferLike>[]>
flush()?
flush?():
| Buffer<ArrayBufferLike>[]
| Promise<Buffer<ArrayBufferLike>[]>;Returns
| Buffer<ArrayBufferLike>[] | Promise<Buffer<ArrayBufferLike>[]>