ESP32-audioI2S icon indicating copy to clipboard operation
ESP32-audioI2S copied to clipboard

8bit DAC's of the ESP32

Open Fire-Dragon-TW opened this issue 2 years ago • 6 comments

How can I use 8bit DAC's of the ESP32

Fire-Dragon-TW avatar May 03 '22 22:05 Fire-Dragon-TW

#include "Audio.h"
#include "FS.h"
#include "SPIFFS.h"

#define I2S_DOUT      25
#define I2S_BCLK      27
#define I2S_LRC       26

Audio audio(true, I2S_DAC_CHANNEL_BOTH_EN);

void setup() {
    Serial.begin(115200);
    audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
    audio.setVolume(21);

    SPIFFS.begin();
    audio.connecttoFS(SPIFFS, "alert.mp3");
}

void loop()
{
    audio.loop();
}

Fire-Dragon-TW avatar May 03 '22 22:05 Fire-Dragon-TW

image image

Fire-Dragon-TW avatar May 03 '22 22:05 Fire-Dragon-TW

speaker is connected to GPIO 26 and GND

Fire-Dragon-TW avatar May 03 '22 22:05 Fire-Dragon-TW

@Fire-Dragon-TW, this issue is not related to the library itself, it is a problem with the Espressif Arduino Core. The last version that the internal DAC works is the 2.0.0. You need to open the board manager on your arduino IDE and downgrade the ESP32 to 2.0.0.

image

The issue was discussed here: https://github.com/espressif/arduino-esp32/issues/5938

ggssantos avatar May 08 '22 12:05 ggssantos

@Fire-Dragon-TW @ggssantos

I want to implement this library because it enables the internal DAC of ESP32 without any other hardware. Can you post a sample audio output recording, to judge the quality of simple speech voice? It would be really helpful to make a final decision. Thank you

jitendra1607 avatar Jun 20 '22 10:06 jitendra1607

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 02:09 stale[bot]