Audio playback shield?

Hi,
I have seen there are various audio shields, but I am not familiar with any of them nor much with the Arduino platform, so any help would be very much appreciated. :slight_smile:

I am looking for a (preferably lossless) audio playback shield whereby I can play a single short file (up to 2 minutes) on a loop but before every audio play it does some other control like turn LEDs on and off and only when that is done then the same audio file is played again.

Is there any lossless shield that allows me to do that, i.e. play only one specific track only when I send a command?

If so, which shield?

Thank you
Rik

ESP32 can play .wav files. It has a built in 8-bit stereo DAC or you can use external I2S DACs.

Your topic does not indicate a problem with IDE 2.x and hence has been moved to a more suitable location on the forum.

Oh yeah? First I've heard of this (not doubting you, just first I've heard). Is it easy to implement? (easy-ish in the Arduino sense, nothing is easy easy but I mean not too much hassle)

I have used and am a satisfied customer of the Adafruit Wave Shield, although I think it's no longer in production maybe due to obsolescence?

The length of the file on these types of shields doesn't matter. Typically, they read the file off an SD card so there is tons of memory for the audio file itself.

Very doable with things like the Wave Shield or any of the mp3 ones around today such as

if those formats suit you. As you may or may not know, Adafruit has an excellent reputation for making high quality products in the Arduino space.

Thank you,
where do I find the full API to use it, especially finding out how many playable files are on the card so I can automatically loop through each of them AND regardless of their title?

Thank you :slight_smile:

Are you asking @cedarlakeinstruments ?
Or

Me?
If me, click the link and you will find a tutorial. Adafruit is great about providing tutorials for the products they sell.

This is what I did (not showing initialization of the I2S subsystem)

void Speak(const short* sound, unsigned long len) 
{
    size_t bytes_written = 0;
    
    i2s_write(Speak_I2S_NUMBER, sound, len*2, &bytes_written, portMAX_DELAY);
    Serial.printf("Wrote %d bytes\r\n",bytes_written);
}

The sound was saved to Flash because it's pretty short: two .wav files for a total of 500kB. I'm pretty sure I have an example somewhere that uses files saved to an SD card.

Made my repo public. Take a look at audioplayer.cpp. It uses the internal DAC but it's not a big deal to add an external I2S DAC and some of them come with built-in amplifiers.

cedarlakeinstruments/ESP32_LVGL_HMI: Basic ESP32-based HMI using LVGL

1 Like

Thank you all. :slight_smile:

@hallowed31 I was asking you. Thank you.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.