https://github.com/lexus2k/audioplayer_esp32
Audio I2S player for ESP32
https://github.com/lexus2k/audioplayer_esp32
audio audio-player esp32 esp32-sound i2s i2s-audio i2s-dac
Last synced: about 1 month ago
JSON representation
Audio I2S player for ESP32
- Host: GitHub
- URL: https://github.com/lexus2k/audioplayer_esp32
- Owner: lexus2k
- License: gpl-3.0
- Created: 2019-04-06T12:44:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-27T22:27:50.000Z (about 3 years ago)
- Last Synced: 2025-02-28T19:38:26.050Z (about 2 months ago)
- Topics: audio, audio-player, esp32, esp32-sound, i2s, i2s-audio, i2s-dac
- Language: C++
- Size: 76.2 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# audioplayer_esp32
Audio I2S player for ESP32To use vgm files please, download this library also: https://github.com/lexus2k/vgm_decoder
AudioPlayer needs it to play vgm filesDemo with playing vgm files on ESP32 is here: https://github.com/lexus2k/vgm_test
## Easy to use
Example
```.cpp
#include "audio_player.h"
#include "nixie_melodies.h"// Let's use 16kHz sound
AudioPlayer audio_player( 16000 );static void main_task(void *pvParameter)
{
/* set prebuffering in milliseconds. It is required, when thread sleeps */
audio_player.set_prebuffering( 50 );
// Use audio_player.begin(EAudioChannels::BOTH, false) to use with external I2S decoder
// Use audio_player.begin(EAudioChannels::BOTH, true) or audio_player.begin() to use with internal built-in I2S DAC decoder
audio_player.begin();
audio_player.play( &melodyMonkeyIslandP );for(;;)
{
audio_player.update();
vTaskDelay(50 / portTICK_PERIOD_MS);
}
audio_player.end();
}```