Files
2026-04-08 16:32:11 +02:00

705 B

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.