short noise at new music start #1914
-
I wrote a simple mp3 player using the library. (esp32, oled display, SD, Bluetooth or wired earplug) I2SStream i2s; //setup |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
Did you try to close and reopen the decoder ? |
Beta Was this translation helpful? Give feedback.
-
I did a detailed test. First I flushed all the buffers. Still noise. Then I checked all the steps one by one, and found, that the decoderBt.end() makes the noise. Even if I set the volume to zero. volumeBt.setVolume(0); |
Beta Was this translation helpful? Give feedback.
-
I could not reproduce your issue (with an AudioKit) with the following simplified test sketch which uses your original logic. #include <SPI.h>
#include <SD.h>
#include "AudioTools.h"
#include "AudioTools/AudioLibs/AudioBoardStream.h"
#include "AudioTools/AudioCodecs/CodecMP3Helix.h"
const int chipSelect=PIN_AUDIO_KIT_SD_CARD_CS;
AudioBoardStream i2s(AudioKitEs8388V1); // final output of decoded stream
EncodedAudioStream decoder(&i2s, new MP3DecoderHelix()); // Decoding stream
File audioFile;
StreamCopy copier(decoder, audioFile);
void setup(){
Serial.begin(115200);
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
// setup I2S
auto config = i2s.defaultConfig(TX_MODE);
config.sd_active = true;
i2s.begin(config);
// setup decoder
decoder.begin();
// setup SD
SD.begin(chipSelect);
// play all files
audioFile = SD.open("/ZZ Top/Unknown Album/Lowrider.mp3");
copier.copyAll();
audioFile = SD.open("/ZZ Top/Unknown Album/Zztop - Cocaine.mp3");
copier.copyAll();
}
void loop(){
delay(1000);
} Are you sure that your issue is not with your mp3 file ? |
Beta Was this translation helpful? Give feedback.
-
If you use your custom mp3 files, you need to make sure that you fade out and add enough silence at the end. The esp32 config has an auto_clear flag, but this should be active by default. |
Beta Was this translation helpful? Give feedback.
Did you try to close and reopen the decoder ?
After all the decoding of an mp3 segment depends on the previous segment, which does not make any sense when you change the file.