chmorgan/esp-audio-player

uploaded 1 day ago
Lightweight audio decoding component for esp processors

readme

Audio player component for esp32

Capabilities

  • MP3 decoding (via libhelix-mp3)
  • Wav/wave file decoding

Who is this for?

Decode only audio playback on esp32 series of chips, where the features and footprint of esp-adf are not necessary.

What about esp-adf?

This component is not intended to compete with esp-adf, a much more fully developed audio framework.

It does however have a number of advantages at the moment including:

  • Fully open source (esp-adf has a number of binary modules at the moment)
  • Minimal size (it's less capable, but also simpler, than esp-adf)

Dependencies

For MP3 support you'll need the esp-libhelix-mp3 component.

Tests

Unity tests are implemented in the test/ folder.

States

stateDiagram-v2
    [*] --> Idle : new(), cb(IDLE)
    Idle --> Playing : play(), cb(PLAYING)
    Playing --> Paused : pause(), cb(PAUSE)
    Paused --> Playing : resume(), cb(PLAYING)
    Playing --> Playing : play(), cb(COMPLETED_PLAYING_NEXT)
    Paused --> Idle : stop(), cb(IDLE)
    Playing --> Idle : song complete, cb(IDLE)
    [*] --> Shutdown : delete(), cb(SHUTDOWN)
    Shutdown --> Idle : new(), cb(IDLE)

Note: Diagram shortens callbacks from AUDIOPLAYEREVENTxxx to xxx, and functions from audioplayer_xxx() to xxx(), for clarity.

Links:

Supports all targets

License: Apache-2.0

To add this component to your project, run:
idf.py add-dependency chmorgan/esp-audio-player^1.0.3
or download archive

Dependencies

  • chmorgan/esp-libhelix-mp3 >=1.0.0,<2.0.0
  • ESP-IDF >=4.1.0