{"id":1433,"date":"2012-07-25T06:54:14","date_gmt":"2012-07-24T22:54:14","guid":{"rendered":"http:\/\/blog.lolyco.com\/sean\/?p=1433"},"modified":"2012-07-25T06:56:39","modified_gmt":"2012-07-24T22:56:39","slug":"lame-problem-encoding-mp3-warning-unsupported-audio-format","status":"publish","type":"post","link":"https:\/\/blog.lolyco.com\/sean\/2012\/07\/25\/lame-problem-encoding-mp3-warning-unsupported-audio-format\/","title":{"rendered":"Lame problem encoding MP3 &#8220;Warning: unsupported audio format&#8221;"},"content":{"rendered":"<p>An <a title=\"Flash cards with sounds\" href=\"http:\/\/wossis.com\/\">old site that I&#8217;ve been meaning to renovate for too long<\/a> gave me this problem today. For the first time in a more than a year I tried to upload an audio clip and it didn&#8217;t work. What&#8217;s supposed to happen is the user uploads images and sounds for flashcards in whatever format they happen to have them in and the server transposes them into a standard format, sanitising them at the same time. The image handling code seemed to work, but I wasn&#8217;t getting anything back for <a title=\"Frog flashcard\" href=\"http:\/\/wossis.com\/flashcard\/35e6c\/animals\/35f4e.html\">the MP3 clip I uploaded<\/a>.<\/p>\n<div id=\"attachment_1436\" style=\"width: 210px\" class=\"wp-caption alignright\"><a href=\"http:\/\/blog.lolyco.com\/sean\/wp-content\/uploads\/2012\/07\/frog.fc0_.jpeg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1436\" class=\"size-full wp-image-1436\" title=\"Frog\" src=\"http:\/\/blog.lolyco.com\/sean\/wp-content\/uploads\/2012\/07\/frog.fc0_.jpeg\" alt=\"Frog\" width=\"200\" height=\"200\" srcset=\"https:\/\/blog.lolyco.com\/sean\/wp-content\/uploads\/2012\/07\/frog.fc0_.jpeg 200w, https:\/\/blog.lolyco.com\/sean\/wp-content\/uploads\/2012\/07\/frog.fc0_-150x150.jpeg 150w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><p id=\"caption-attachment-1436\" class=\"wp-caption-text\">Frog<\/p><\/div>\n<p>I saw the &#8220;Warning: unsupported audio format&#8221; in the server logs and immediately decided that I&#8217;d forgotten some corner cases of sound formats that just didn&#8217;t work. After trying a few different formats, I tried to run the shell script that does the conversion on some of the old uploads (the original media is saved, but not accessible to web clients). Lame gave the same error message for those too.<\/p>\n<p>A search for the warning message led me to <a href=\"http:\/\/www.unix.com\/302411118-post8.html\">this page at unix.com<\/a>. I needed the &#8211;mp3input argument because I save user uploads with a generic name, not their original &#8216;content-hinting&#8217; extension. The shell script had been working just fine way back when I added the content that&#8217;s already there, so perhaps lame&#8217;s behaviour has changed in the interim. It&#8217;s certainly made explicit in the man documentation:<\/p>\n<blockquote><p>&#8211;mp3input<br \/>\nAssume the input file is a MP3 file.<br \/>\nUseful for downsampling from one mp3 to another.\u00a0 As an example, it can be useful for streaming through an IceCast server.<br \/>\nIf\u00a0 the\u00a0 filename\u00a0 ends in &#8220;.mp3&#8221; LAME will assume it is an MP3.\u00a0 <strong>For stdin or MP3 files which do not end in .mp3 you need to use this switch.<\/strong><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>An old site that I&#8217;ve been meaning to renovate for too long gave me this problem today. For the first time in a more than a year I tried to upload an audio clip and it didn&#8217;t work. What&#8217;s supposed to happen is the user uploads images and sounds for flashcards in whatever format they [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-1433","post","type-post","status-publish","format-standard","hentry","category-foss"],"_links":{"self":[{"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/posts\/1433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/comments?post=1433"}],"version-history":[{"count":4,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/posts\/1433\/revisions"}],"predecessor-version":[{"id":1438,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/posts\/1433\/revisions\/1438"}],"wp:attachment":[{"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/media?parent=1433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/categories?post=1433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lolyco.com\/sean\/wp-json\/wp\/v2\/tags?post=1433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}