Poor audio with ESP32-S3 Reverse TFT Feather and MAX98357

I have a ESP32-S3 Reverse TFT Feather, a 3 Watt 8 Ohm Mini Speaker, and a MAX98357 Audio Power Amplifier
I am using this library GitHub - schreibfaul1/ESP32-audioI2S: Play mp3 files from SD via I2S

The audio can briefly sound good, but then the audio can become very distorted, almost robotic. Also the volume seems to fluctuate as well.

I'm also using the libraries text to speech function

#include <WiFi.h>
#include <HTTPClient.h>
const char* ssid     = "my_ssid";
const char* password = "my_pwd";
#include <ESPAsyncWebServer.h>
AsyncWebServer server(80);
#include "Arduino.h"
#include "Audio.h"
#define I2S_DOUT  37
#define I2S_BCLK  38
#define I2S_LRC   39
Audio audio;

class Button {
  public:
    int numberpin;bool ispressed = false;
    Button (int pin){numberpin = pin;}
    virtual void onPressDown(){} virtual void onPressUp(){}
    void listen()
    {
      int buttonState = digitalRead(numberpin);
      if (buttonState == 1){if (!ispressed){onPressDown();ispressed=true;}}
      else{if (ispressed){onPressUp();ispressed=false;}}
    }
};

class ButtonOne : public Button {
  public:
  ButtonOne(int pin) : Button(pin) {}
  /*add custom method*/
  void onPressUp( ) override{ 
    audio.connecttospeech("Mr and Mrs Dursley of number four, Privet Drive, were proud to say that they were perfectly normal, thank you very much","en");
    delay(100);
  }
};


ButtonOne buttonOne(1);

void setup() {

  Serial.begin(115200);
  pinMode(1, INPUT_PULLDOWN);


  audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
  audio.setVolume(21); // 0 <> 21

  WiFi.begin(ssid, password);
  // Serial.println("Connecting");
  while(WiFi.status() != WL_CONNECTED) {
    delay(500);
    // Serial.print(".");
  }
}

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

i am using this board Adafruit ESP32-S3 Reverse TFT Feather [4MB Flash, 2MB PSRAM, STEMMA QT] : ID 5691 : Adafruit Industries, Unique & fun DIY electronics and kits that has a built in button ( pulled LOW by default) on pin 1

How is the audio amplifier powered? Hopefully not from any ESP pin.

I have tried a dedicated 5 volt source, 3.3 volt source, and (admittedly) the 3.3 volt esp32 pin. All have the same audio distortion

Okey. What does the datasheets for those power sources say versus the datasheet of the audio board?
It smells lack of power due to the description.

I’d agree , your diagram shows audio power is derived from the processor board - it can’t do that

I still have the effect and I've tried two different 5 volt sources. One being a wall plug that can give 3 amps. I wish I could send a recording... It almost sounds like an intentional robotic sound effect. It is an inconsistency because sometimes the speaker sounds fine and then randomly it's the slowed down robot distorted voice for a few seconds.

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