sd mp3 to i2s: When playing a sound multiple times it plays the ending of whatever was played previously at the start. #1877
-
Hi, I'm making some electronic air drums for my university project. An esp32 connected to some drumsticks (with an accelerometer and gyroscope) sends data to another esp32 to turn it into sound. For example, if this is sent: My issue is that when I play a sound from the sd card it plays the ending of the previous sound before playing the current sound. The first time a sound is played this doesn't happen. Even if I only try and repeat the same sound it still plays the ending of the sound at the start. (I wonder if the buffer isn't fully cleared each time. Is there a way to clear the buffer?) here is my implementation:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You forgot to call end() and begin() on the decoder before you start a new mp3 file. You could also think about sending just some silence data to i2s if you don't provide any audio data... |
Beta Was this translation helpful? Give feedback.
You forgot to call end() and begin() on the decoder before you start a new mp3 file.
I guess you could avoid this by just using pcm data.
You could also think about sending just some silence data to i2s if you don't provide any audio data...