{"id":211,"date":"2016-02-28T16:26:09","date_gmt":"2016-02-28T16:26:09","guid":{"rendered":"http:\/\/alain.fi\/?p=211"},"modified":"2019-07-30T04:00:25","modified_gmt":"2019-07-30T04:00:25","slug":"mp3-add-silence-beginning-or-end-linux-command-line","status":"publish","type":"post","link":"https:\/\/alain.fi\/?p=211","title":{"rendered":"Mp3 add silence beginning or end, Linux command line"},"content":{"rendered":"<p>To add silence at the beginning or at the end of an mp3 file, use &#8220;sox&#8221; with &#8220;pad&#8221;:<\/p>\n<pre>sox original.mp3 new.mp3 pad 2.5 0<\/pre>\n<p>This adds 2.5s of blank space at the beginning of the mp3 file, 0s at the end<\/p>\n<p>Automate this for a batch of file, put results files in .\/output folder:<\/p>\n<pre>for i in .\/*.mp3; do sox $i output\/$i pad 2.5 0; done<\/pre>\n<p>To remove part of the track, use &#8220;trim&#8221; &#8220;when to start&#8221; &#8220;when to end&#8221;. Example to keep only audio from 2.5s to 20s:<\/p>\n<pre>sox original.mp3 trimmedpart.mp3 trimmed 2.5 20<\/pre>\n<p>If you want to remove only some seconds at start, just put the second number higher than the actual duration of the track.<\/p>\n<p>Make sure you installed\u00a0libsox-fmt-mp3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To add silence at the beginning or at the end of an mp3 file, use &#8220;sox&#8221; with &#8220;pad&#8221;: sox original.mp3 new.mp3 pad 2.5 0 This adds 2.5s of blank space at the beginning of the mp3 file, 0s at the &hellip; <a href=\"https:\/\/alain.fi\/?p=211\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-211","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/alain.fi\/index.php?rest_route=\/wp\/v2\/posts\/211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alain.fi\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alain.fi\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alain.fi\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alain.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=211"}],"version-history":[{"count":5,"href":"https:\/\/alain.fi\/index.php?rest_route=\/wp\/v2\/posts\/211\/revisions"}],"predecessor-version":[{"id":216,"href":"https:\/\/alain.fi\/index.php?rest_route=\/wp\/v2\/posts\/211\/revisions\/216"}],"wp:attachment":[{"href":"https:\/\/alain.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alain.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alain.fi\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}