Skip to main content

Crate rusty_esp_audio_core

Crate rusty_esp_audio_core 

Source
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):

  1. no_std by default; alloc is a feature, never an assumption.
  2. No drivers, no HAL types, no esp-* crate, no allocator. Backends live in rusty_esp_audio-esp.
  3. Every type that crosses to another Janus package comes from rusty_esp_core, so packages compose without conversions.
  4. Blocks and buffers are borrowed over caller-owned memory; no element allocates, ever — not even at construction.
  5. forbid(unsafe). The scalar path is the oracle; any faster path is gated byte-identical against it.

Layout:

modulecontents
sourceAudioSource / AudioSink, a test tone, a counting sink
ringRingBuffer: whole-frame SPSC ring over a caller slice
pipelineElement and Pipeline<N>: the fixed-block graph
elementsgain, DC block, RBJ biquads, AGC, energy VAD, channel ops, linear resampler, format conversion
codecpcm conversions, adpcm_ima (IMA ADPCM, WAV layout), wav headers
chipcodec 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 house rusty_flac behind the flac feature (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 Element over interleaved i16.
pipeline
Element and Pipeline: ESP-ADF’s audio_element / audio_pipeline remade 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’s ringbuf remade 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 768 for i16::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.