Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified AudioFileSource ID3 to enable tag skipping. #350

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

troisiemetype
Copy link
Contributor

@troisiemetype troisiemetype commented Dec 15, 2020

Hello,

This follows the issue #349 opened sooner this day, about the random buffer silence / noise at the beginning of a mp3 play.

For what I understand, when reading a mp3, two things can happen :

  • we want to read tags : an AudioFileSourceID3 object is created, which is called from AudioGeneratorMP3. It reads the tags, and simply relays the data from file when the job is done. Fine, when the tags have been read the music starts.
  • we don't want to read tags : an AudioFileSourceXXX is created, but between the beginning of the file and the beginning of audio data (i.e. when in tag data), the AudioOutputXXX reads from a buffer which is not updated.

So, I've modified the AudioFileSourceID3 to add the following : a bool skip member variable, that can be changed in the constructor, and defaults to 0 : AudioFileSourceID3(AudioFileSource *src, bool skip = false);

This variable is tested once the tag header has been parsed, and its size is known. If true, the size of the tag section is skipped, and music can start immediately.

edit : I believe this is not the better way to solve this problem. By reading issue #347, it seems that the same behavior can happen with other file types as well.

Pierre-Loup Martin added 3 commits November 15, 2020 19:05
…ned into the fs namespace in esp32 libraries.
Changed framesize loop with 32bit counter to avoid endless loops for large frames (like APIC).
In callback, corrected typo : 'Track' instead of 'track'.
Added 'skip' boolean in the constructor, so the whole tag can be skipped once its size is known.
@volkerjooss
Copy link

This changes solved my issue with noice at the beginning of the track.
I think it is mainly caused by to cover included in id3 tags.

@sittelle
Copy link

Any updates on this matter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants