Updated libraries (button and audio player) (#16)

This PR updates two dependency libraries to their latest versions:

## espressif/button: v3.5.0 to v4.1.5

[Version 4](https://components.espressif.com/components/espressif/button/versions/4.1.5/changelog?language=en) changed the API.  This code makes use of the new API, with no change to the existing behavior.

## chmorgan/esp-audio-player: v1.0.7 to v1.1.0

[Version 1.1.0](https://github.com/chmorgan/esp-audio-player/releases/tag/v1.1.0) introduces the possibility of multiple simultaneous audio streams.  This feature is as yet unused by KTag.

Co-authored-by: Joe Kearney <joe@clubk.club>
Reviewed-on: #16
This commit is contained in:
Joe Kearney 2026-02-07 22:30:37 +00:00
parent d86c494d45
commit 89166c8a02
101 changed files with 5845 additions and 2391 deletions

View file

@ -7,6 +7,7 @@
* MP3 decoding (via libhelix-mp3)
* Wav/wave file decoding
* Audio mixing (multiple concurrent streams)
## Who is this for?
@ -49,6 +50,40 @@ For MP3 support you'll need the [esp-libhelix-mp3](https://github.com/chmorgan/e
Unity tests are implemented in the [test/](../test) folder.
## Audio Mixer
The Audio Mixer allows for concurrent playback of multiple audio streams. It supports two types of streams:
* **Decoder Streams**: For playing MP3 or WAV files. Each stream runs its own decoding task.
* **Raw PCM Streams**: For writing raw PCM data directly to the mixer.
### Basic Mixer Usage
1. Initialize the mixer with output format and I2S write functions.
2. Create one or more streams using `audio_stream_new()`.
3. Start playback on the streams.
```c
audio_mixer_config_t mixer_cfg = {
.write_fn = bsp_i2s_write,
.clk_set_fn = bsp_i2s_reconfig_clk,
.i2s_format = {
.sample_rate = 44100,
.bits_per_sample = 16,
.channels = 2
},
// ...
};
audio_mixer_init(&mixer_cfg);
audio_stream_config_t stream_cfg = DEFAULT_AUDIO_STREAM_CONFIG("bgm");
audio_stream_handle_t bgm_stream = audio_stream_new(&stream_cfg);
FILE *f = fopen("/sdcard/music.mp3", "rb");
audio_stream_play(bgm_stream, f);
```
## States
```mermaid