MP3 files can contain metadata that stores information about the title, the author etc. If you send an MP3 stream with metadata to a decoder, the logic is usually resilient enough to skip this automatically. However there can be some cases where the codec can’t cope and is crashing.

One way to deal with this, is to remove the metadata from the file. But a more flexible solution is to just filter out the metadata on the fly, before sending it to the decoder. My AudioTools library covers this functionality with the help of the MetaDataFilter class.

Just (as usual) build a chain like e.g. this:

#include "AudioTools.h"
#include "AudioTools/AudioCodecs/CodecMP3Helix.h"

I2SStream i2s;                           // Output stream
MP3DecoderHelix mp3;                     // Decoder
EncodedAudioStream decoder(i2s, mp3);  // Decoding stream
MetaDataFilter filter(decoder);          // remove metadata


and copy the data to the filter!


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *