Skip to content

Introducing the Fonix Audio Decoders, Built From Scratch for ESP32

Introducing the Fonix Audio Decoders, Built From Scratch for ESP32

Today we're excited to announce a major milestone for the Fonix One: the entire audio decode pipeline is now fully self-contained, without third-party codec dependencies.

Why we built our own decoders

The Fonix One previously relied on the libhelix MP3 and AAC decoders, originally developed by RealNetworks under RPSL/RCSL licensing. While functional, these carried licensing restrictions that complicated commercial distribution. With all essential MP3 and AAC-LC patents expired since 2017, we had a clear path to build something better, and something truly ours.

What we built

Fonix MP3 supports all MPEG-1/2/2.5 Layer III sample rates (8–48 kHz), every stereo mode, and full bit reservoir support. The decode pipeline runs from Huffman decode through dequantisation, stereo processing, IMDCT, and 32-subband polyphase synthesis to 16-bit PCM output. Three hand-written Xtensa assembly modules optimise the hottest loops, and output quality is a near bit-perfect match with the previous decoder.

Fonix AAC handles AAC-LC at all 12 standard sample rates (8–96 kHz) in both ADTS and raw block mode for M4A containers. It features a full 1024-point IMDCT via a custom radix-4 FFT core, perceptual noise substitution, temporal noise shaping, and sine/KBD windowing, all in fixed-point arithmetic. At 44.1 kHz stereo, a frame decodes in roughly 5 ms against a 23 ms budget, leaving 78% headroom for the rest of the system.

Together, the two decoders represent approximately 9,500 lines of hand-written C and 900 lines of Xtensa assembly, backed by over 230 unit and integration tests. Both operate within a shared 25 KB memory pool using pure fixed-point arithmetic, no floating-point dependencies whatsoever.

What this means for the Fonix One

Combined with our existing custom FLAC and WAV decoders, every audio format the Fonix One supports is now decoded by code we wrote and optimised specifically for the ESP32's Xtensa LX6 processor. No borrowed code, no licensing grey areas, just purpose-built audio engineering for a purpose-built player.

Stay tuned, the start of our Kickstarter Campaign won't be far off now, and we can't wait to share all the details with you once it's up and running!