Add ESP32-C3 Opus loopback example

This commit is contained in:
Martin Linkwitz - NUC
2026-04-08 16:32:11 +02:00
parent 3551b073d7
commit 75672d4ec4
2 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
This sketch is a minimal ESP32-C3 Opus codec smoke test.
What it does:
- Generates a sine wave locally
- Encodes it with Opus
- Decodes it immediately again
- Sends the decoded PCM to I2S
Why this example:
- It tests the raw Opus codec path without Ogg or CAN framing
- It is closer to the later Pi -> CAN -> ESP32 decoder path than MP3
- It keeps CPU load down by using 16 kHz mono and low encoder complexity
Expected hardware:
- ESP32-C3
- I2S DAC / amp on:
- BCLK = GPIO 6
- LRCK = GPIO 7
- DIN = GPIO 5
Required Arduino libraries:
- `arduino-audio-tools`
- `arduino-libopus`
If this sketch runs and outputs a stable sine tone, the basic Opus encode/decode
chain is working on the ESP32-C3.