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

Decode and play seperately

Open 48mert opened this issue 1 year ago • 1 comments

Hello,

Can I play multiple MP3 files back-to-back using the audio.connecttofs command without having a gap or pause between them? When using the audio.connecttofs command to play multiple MP3 files there is always a little pause that occurs inbetween. Maybe decode them and play all afterwards (Buffer,...?) Thank you

48mert avatar Dec 25 '23 19:12 48mert

MP3 is hard to achieve gapless playback on.

Read https://en.wikipedia.org/wiki/Gapless_playback

Note: "Lossy audio compression schemes that are based on overlapping time/frequency transforms add a small amount of padding silence to the beginning and end of each track. These silences increase the playtime of the compressed audio data.[1] If not trimmed off upon playback, the two silences played consecutively over a track boundary will appear as a pause in the original audio content. Lossless formats are not prone to this problem."

"For some audio formats (e.g. Ogg Vorbis), where the start and end are precisely defined, the padding is implicitly trimmed off in the decoding process. Other formats may require extra metadata for the player to achieve the same. The popular MP3 format defines no way to record the amount of delay or padding for later removal."

Also some more info here: https://wiki.hydrogenaud.io/index.php?title=Gapless

ma261065 avatar Jan 08 '24 08:01 ma261065