Expand description
rusty_esp_audio-core — the pure heart of rusty_esp_audio.
ESP-ADF’s audio_pipeline / audio_element / ringbuf, esp_audio_codec’s
PCM/ADPCM framing and the lite front end of ESP-SR, remade as fixed-block
elements over caller-owned memory.
Rules this crate lives by (from the Janus mission plan):
no_stdby default;allocis a feature, never an assumption.- No drivers, no HAL types, no
esp-*crate, no allocator. Backends live inrusty_esp_audio-esp. - Every type that crosses to another Janus package comes from
rusty_esp_core, so packages compose without conversions. - Blocks and buffers are borrowed over caller-owned memory; no element allocates, ever — not even at construction.
forbid(unsafe). The scalar path is the oracle; any faster path is gated byte-identical against it.
Layout:
| module | contents |
|---|---|
source | AudioSource / AudioSink, a test tone, a counting sink |
ring | RingBuffer: whole-frame SPSC ring over a caller slice |
pipeline | Element and Pipeline<N>: the fixed-block graph |
elements | gain, DC block, RBJ biquads, AGC, energy VAD, channel ops, linear resampler, format conversion |
codec | pcm conversions, adpcm_ima (IMA ADPCM, WAV layout), wav headers |
chip | codec chips as register data over embedded-hal I²C: es8311 (ADC + DAC), es7210 (4-channel ADC) |
Re-exports§
pub use pipeline::Element;pub use pipeline::Pipeline;pub use ring::RingBuffer;pub use source::AudioSink;pub use source::AudioSource;pub use rusty_esp_core as esp_core;
Modules§
- chip
- Codec chips as register data —
esp_codec_dev’s drivers remade. - codec
- Framing and conversion:
esp_audio_codec’s PCM/ADPCM remade, plus WAV headers, plus FLAC through the houserusty_flacbehind theflacfeature (the one allocating module). Lossy codecs are a measured decision (A4). - elements
- The elements: ESP-ADF’s filter/resample/mixer elements and ESP-SR’s lite
front end, each an
Elementover interleaved i16. - pipeline
ElementandPipeline: ESP-ADF’saudio_element/audio_pipelineremade as a fixed-block chain over two halves of one caller scratch buffer.- prelude
- The names a sketch or firmware wants in scope.
- ring
RingBuffer: ESP-ADF’sringbufremade as a whole-frame ring over a caller-owned slice.- source
- Where blocks come from and where they go.
Constants§
- VERSION
- Crate version, for capability manifests and logs.
Functions§
- peak_
abs_ i16 - Level of an interleaved i16 block in dBFS —
rusty_esp_dsp’s reduction (moved there in D0, 2026-09-02), at the path this crate always had. The largest magnitude in the block (32 768fori16::MIN). - rms_
dbfs_ i16 - Level of an interleaved i16 block in dBFS —
rusty_esp_dsp’s reduction (moved there in D0, 2026-09-02), at the path this crate always had. Level of an interleaved i16 block in dBFS (RMS over all channels). Digital silence returns-120.0.