{"id":895,"date":"2010-02-05T23:27:21","date_gmt":"2010-02-06T07:27:21","guid":{"rendered":"http:\/\/www.curlybrace.com\/words\/?p=895"},"modified":"2010-08-08T13:24:32","modified_gmt":"2010-08-08T20:24:32","slug":"converting-mp3-to-aac","status":"publish","type":"post","link":"https:\/\/www.curlybrace.com\/words\/2010\/02\/converting-mp3-to-aac\/","title":{"rendered":"Converting MP3 to AAC"},"content":{"rendered":"<p>Here is a Windows command shell script I wrote to convert MP3 files to AAC for my Softbank 821SC phone.  The script uses FFmpeg, which I downloaded from <a href=\"http:\/\/ffmpeg.arrozcru.org\/autobuilds\/\">here<\/a>.<\/p>\n<blockquote>\n<pre class=\"DOS\">\r\n@echo off\r\n\r\nREM ---------------------------------------------------------------------------\r\nREM  Set the following variable to the ffmpeg.exe path on your system.\r\nREM ---------------------------------------------------------------------------\r\nset FFMPEG_PATH=\"c:\\tools\\FFmpeg\\ffmpeg.exe\"\r\n\r\nREM make sure the user provided an argument.\r\nif NOT \"%~1\" == \"\" goto ARGS_OK\r\n\r\nREM bad arguments, print error and exit.\r\necho.\r\necho    Usage examples:\r\necho       mp3toaac.bat file_to_convert.mp3\r\necho       mp3toaac.bat *.mp3\r\necho       mp3toaac.bat some_directory\\*.mp3\r\nexit \/b 1\r\n\r\n:ARGS_OK\r\n\r\nREM use for\/in so that we can accept individual files or wildcards.\r\nfor %%i in (\"%~1\") do %FFMPEG_PATH% -i \"%%~i\" \"%%~ni.aac\"\r\n\r\necho.\r\necho Done.\r\n\r\nexit \/b 0\r\n<\/pre>\n<\/blockquote>\n<p>Interesting elements of this batch file:<\/p>\n<ul>\n<li \/>Use of <tt>for<\/tt>\/<tt>in<\/tt> in order to accept both filenames and wildcards.\n<li \/>Use of <tt>%~<i>X<\/i><\/tt> to strip parentheses from a filename variable.\n<li \/>Use of <tt>%~n<i>X<\/i><\/tt> to strip the extension from a filename variable (i.e. retrieve the basename).\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Here is a Windows command shell script I wrote to convert MP3 files to AAC for my Softbank 821SC phone. The script uses FFmpeg, which I downloaded from here. @echo off REM &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; REM Set the following variable to the &hellip; <a href=\"https:\/\/www.curlybrace.com\/words\/2010\/02\/converting-mp3-to-aac\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[193,15,283],"tags":[],"class_list":["post-895","post","type-post","status-publish","format-standard","hentry","category-scripting","category-technology","category-windows-technology"],"_links":{"self":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/comments?post=895"}],"version-history":[{"count":7,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/895\/revisions"}],"predecessor-version":[{"id":1239,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/895\/revisions\/1239"}],"wp:attachment":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/media?parent=895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/categories?post=895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/tags?post=895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}