{"id":6440,"date":"2024-10-29T08:46:39","date_gmt":"2024-10-29T07:46:39","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=6440"},"modified":"2024-10-29T10:16:20","modified_gmt":"2024-10-29T09:16:20","slug":"removing-metadata-when-decoding-mp3","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/","title":{"rendered":"Filtering Out Metadata Before Decoding MP3"},"content":{"rendered":"<p><strong>MP3 files<\/strong> can contain <strong>metadata<\/strong> 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&#8217;t cope and is crashing.<\/p>\n<p>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 <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">AudioTools library<\/a> covers this functionality with the help of the <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_meta_data_filter.html\">MetaDataFilter class<\/a>.<\/p>\n<p>Just (as usual) build a chain like e.g. this:<\/p>\n<pre><code>#include \"AudioTools.h\"\n#include \"AudioTools\/AudioCodecs\/CodecMP3Helix.h\"\n\nI2SStream i2s;                           \/\/ Output stream\nMP3DecoderHelix mp3;                     \/\/ Decoder\nEncodedAudioStream decoder(i2s, mp3);  \/\/ Decoding stream\nMetaDataFilter filter(decoder);          \/\/ remove metadata\n\n\n<\/code><\/pre>\n<p>and copy the data to the filter!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t cope and is crashing. One [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20,22,1],"tags":[38],"class_list":["post-6440","post","type-post","status-publish","format-standard","hentry","category-arduino","category-machine-sound","category-generic","tag-codecs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Filtering Out Metadata Before Decoding MP3 - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Filtering Out Metadata Before Decoding MP3 - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"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&#8217;t cope and is crashing. One [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-29T07:46:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-29T09:16:20+00:00\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Filtering Out Metadata Before Decoding MP3\",\"datePublished\":\"2024-10-29T07:46:39+00:00\",\"dateModified\":\"2024-10-29T09:16:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/\"},\"wordCount\":121,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"keywords\":[\"Codecs\"],\"articleSection\":[\"Arduino\",\"Machine Sound\",\"Other Topics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/\",\"name\":\"Filtering Out Metadata Before Decoding MP3 - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"datePublished\":\"2024-10-29T07:46:39+00:00\",\"dateModified\":\"2024-10-29T09:16:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/10\\\/29\\\/removing-metadata-when-decoding-mp3\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Filtering Out Metadata Before Decoding MP3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Filtering Out Metadata Before Decoding MP3 - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/","og_locale":"en_US","og_type":"article","og_title":"Filtering Out Metadata Before Decoding MP3 - Phil Schatzmann","og_description":"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&#8217;t cope and is crashing. One [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/","og_site_name":"Phil Schatzmann","article_published_time":"2024-10-29T07:46:39+00:00","article_modified_time":"2024-10-29T09:16:20+00:00","author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Filtering Out Metadata Before Decoding MP3","datePublished":"2024-10-29T07:46:39+00:00","dateModified":"2024-10-29T09:16:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/"},"wordCount":121,"commentCount":1,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"keywords":["Codecs"],"articleSection":["Arduino","Machine Sound","Other Topics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/","url":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/","name":"Filtering Out Metadata Before Decoding MP3 - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"datePublished":"2024-10-29T07:46:39+00:00","dateModified":"2024-10-29T09:16:20+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/10\/29\/removing-metadata-when-decoding-mp3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Filtering Out Metadata Before Decoding MP3"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=6440"}],"version-history":[{"count":6,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6440\/revisions"}],"predecessor-version":[{"id":6446,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6440\/revisions\/6446"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=6440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=6440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=6440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}