[{"data":1,"prerenderedAt":124},["ShallowReactive",2],{"blog-post-sox-trim-audio":3,"recent-posts":80},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":16},"avh2BREAACsAj-57","sox-trim-audio",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2BREAACsAj-57%22%29+%5D%5D",[],"2026-11-18T22:45:43+0000",[12],"sox-how-to-trim-audio",[],"en-us",[],{"title":17,"date":23,"description":24,"image":29,"content":39},[18],{"type":19,"text":20,"spans":21,"direction":22},"heading1","SoX: How to Trim Audio",[],"ltr","2026-11-18",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to trim audio files from the start, end or middle using SoX",[],{"dimensions":30,"alt":20,"copyright":6,"url":33,"id":34,"edit":35},{"width":31,"height":32},1280,720,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FuxvNV-Rsgm5-5KyY_sox-trim-audio.png?auto=format,compress","uxvNV-Rsgm5-5KyY",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,52,55,58,61,64,67,70,73,77],{"type":41,"text":42,"spans":43,"direction":22},"heading3","Install SoX",[],{"type":45,"text":46,"spans":47,"direction":22},"paragraph","Before we start, make sure you have Homebrew installed on your computer and an audio file ready in a folder. Install SoX with this command:",[],{"type":49,"text":50,"spans":51,"direction":22},"preformatted","brew install sox",[],{"type":41,"text":53,"spans":54,"direction":22},"Trim a Section",[],{"type":45,"text":56,"spans":57,"direction":22},"First, open your terminal and navigate to the folder that has your audio file. To keep just a piece of the song, run this command:",[],{"type":49,"text":59,"spans":60,"direction":22},"sox input.wav output.wav trim 5 5",[],{"type":45,"text":62,"spans":63,"direction":22},"Just remember to replace \u003Ccode>input.wav\u003C\u002Fcode> with your actual filename, and \u003Ccode>output.wav\u003C\u002Fcode> with the name you want for the new file. The \u003Ccode>trim\u003C\u002Fcode> effect takes two numbers: the first \u003Ccode>5\u003C\u002Fcode> is where to start in seconds, and the second \u003Ccode>5\u003C\u002Fcode> is how long to keep. So this keeps five seconds, starting at the five second mark.",[],{"type":45,"text":65,"spans":66,"direction":22},"For a short clip, this finishes almost instantly, and SoX won't print a success message. To make sure everything worked, run \u003Ccode>soxi -d output.wav\u003C\u002Fcode>. The \u003Ccode>-d\u003C\u002Fcode> flag prints just the duration, which should read \u003Ccode>00:00:05.00\u003C\u002Fcode>.",[],{"type":41,"text":68,"spans":69,"direction":22},"Trim From the Start or the End",[],{"type":45,"text":71,"spans":72,"direction":22},"If you leave out the second number, SoX keeps everything from your start point to the end of the file. For example, \u003Ccode>trim 5\u003C\u002Fcode> removes the first five seconds. To cut something off the end instead, use a negative number: \u003Ccode>trim 0 -3\u003C\u002Fcode> removes the last three seconds.",[],{"type":74,"oembed":75},"embed",{"embed_url":76,"type":74},"",{"type":45,"text":78,"spans":79,"direction":22},"If you hear a tiny click at the edges of your clip, just add \u003Ccode>fade 0.01 0 0.01\u003C\u002Fcode> to the end of your command to smooth out the cut.",[],{"results":81,"page":37,"results_per_page":122,"results_size":122,"total_results_size":123,"total_pages":37},[82,101,103],{"id":83,"uid":84,"url":6,"type":7,"href":85,"tags":86,"first_publication_date":10,"last_publication_date":10,"slugs":87,"linked_documents":89,"lang":14,"alternate_languages":90,"data":91},"avh2CREAACsAj-6V","pandoc-convert-pdf-to-markdown","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2CREAACsAj-6V%22%29+%5D%5D",[],[88],"pandoc-how-to-convert-pdf-to-markdown",[],[],{"image":92,"title":98},{"dimensions":93,"alt":94,"copyright":6,"url":95,"id":96,"edit":97},{"width":31,"height":32},"Pandoc: How to Convert PDF to Markdown","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F-p25dHHmH8oerC6a_pandoc-convert-pdf-to-markdown.png?auto=format,compress","-p25dHHmH8oerC6a",{"x":36,"y":36,"zoom":37,"background":38},[99],{"type":19,"text":94,"spans":100,"direction":22},[],{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":102},{"image":29,"title":17},{"id":104,"uid":105,"url":6,"type":7,"href":106,"tags":107,"first_publication_date":10,"last_publication_date":10,"slugs":108,"linked_documents":110,"lang":14,"alternate_languages":111,"data":112},"avh2BxEAACcAj-6H","sox-fix-unsupported-audio-format","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2BxEAACcAj-6H%22%29+%5D%5D",[],[109],"sox-how-to-fix-unsupported-audio-format",[],[],{"image":113,"title":119},{"dimensions":114,"alt":115,"copyright":6,"url":116,"id":117,"edit":118},{"width":31,"height":32},"SoX: How to Fix Unsupported Audio Format","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FWi9VtwU58Nuu2b8Q_sox-fix-unsupported-audio-format.png?auto=format,compress","Wi9VtwU58Nuu2b8Q",{"x":36,"y":36,"zoom":37,"background":38},[120],{"type":19,"text":115,"spans":121,"direction":22},[],3,69,1795041965066]