earlephilhower / ESP8266Audio

Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
GNU General Public License v3.0
1.99k stars 433 forks source link

Wav can't hear the melody noise #575

Closed murarduino closed 1 year ago

murarduino commented 1 year ago

MCU: ESP32-PICO-V3-02 Wav file: 22MHZ/8bit or 44.1MHZ/8bit DAC: adafruit-max98357 DAC power supply 3.3/5V

Tested with various attempts above, but the noise is always there - barely audible melody.

include

include "SPIFFS.h"

include "AudioFileSourceSPIFFS.h"

include "AudioOutputI2S.h"

include "AudioOutputMixer.h"

include "AudioGeneratorWAV.h"

AudioGeneratorWAV wav[2]; AudioFileSourceSPIFFS file[2]; AudioOutputI2S out; AudioOutputMixer mixer; AudioOutputMixerStub *stub[2];

void setup() { Serial.begin(115200); SPIFFS.begin(); delay(500); file[0] = new AudioFileSourceSPIFFS("/demo.wav"); out = new AudioOutputI2S(); out->SetOutputModeMono(true); out->SetPinout(15, 13, 2); out->SetBitsPerSample(8); out->stop(); mixer = new AudioOutputMixer(64, out); stub[0] = mixer->NewInput(); stub[0]->SetGain(0.8); wav[0] = new AudioGeneratorWAV(); wav[0]->begin(file[0], stub[0]); Serial.printf("starting 1\n"); .........

murarduino commented 1 year ago

I am researching https://github.com/earlephilhower/ESP8266Audio/issues/24 but it makes me more confused due to the need to store a large number of sound files. So Wav Bit Detph I try to choose is 8 bit. My idea was to use mono instead of binaural to reduce the Wav file size by half. For the adafruit max98357 module, I didn't make any additional adjustments (I am that this will default to the Left channel). Note that SD is the pull-up 100K resistor. (The SD pin on the module is floating). The unified supply is 3.3V, and there is no series resistor on the DIN (what is appropriate if needed?). Is the above problem the solution to the noise that causes the melody to be unheard? I 'm not sure, or do I need to force a single left channel when a function is called?

murarduino commented 1 year ago

In addition, I have the maximum gain of +15db, is that the problem?

murarduino commented 1 year ago

The problem has been solved. I made a stupid mistake because the GND pin of MAX98357 has a cold solder joint, which may cause unstable return ground of the chip. It was soldered again, and a clean sound could be heard.