<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; batch conversion</title> <atom:link href="http://www.ghacks.net/tag/batch-conversion/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Convert .mp3 files to .wav files in Linux</title><link>http://www.ghacks.net/2008/12/19/convert-mp3-files-to-wav-files-in-linux/</link> <comments>http://www.ghacks.net/2008/12/19/convert-mp3-files-to-wav-files-in-linux/#comments</comments> <pubDate>Fri, 19 Dec 2008 00:59:33 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Music and Video]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[batch conversion]]></category> <category><![CDATA[convert mp3]]></category> <category><![CDATA[linux mp3]]></category> <category><![CDATA[linux tips]]></category> <category><![CDATA[mp3 converter]]></category> <category><![CDATA[mpg123]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=9160</guid> <description><![CDATA[With the popularity of mp3 players, and the frustrations of using DRM-crippled music, it is always nice to be able to rip your own mp3 files. There are plenty of Linux tools to handle this task. But what about the mp3 collection that you want to burn onto a playable CD? Although there are many [...]]]></description> <content:encoded><![CDATA[<p>With the popularity of mp3 players, and the frustrations of using DRM-crippled music, it is always nice to be able to rip your own mp3 files. There are plenty of Linux tools to handle this task. But what about the mp3 collection that you want to burn onto a playable CD? Although there are many CD players that will play mp3 format, not all will. For that you need to have .wav file format on the CD. One tool for this conversion is the command-line  mpg123 utility. The mpg123 command can do a lot of things, one of the things it is best at is conversion. In this article I am going to show you how to install mpg123 and then use it to convert mp3 files to wav files.</p><p><span
id="more-9160"></span>The first thing to do is to get mpg123 installed. This can be done very quickly via command line. One of the following commands will do the trick (depending upon which distribution you use):</p><p><em>apt-get install mpg123</em></p><p><em>urpmi mpg123</em></p><p>If you are using Fedora Core you will most likely have to stop by <a
title="pbone.net" href="http://rpm.pbone.net" target="_blank">rpm.pbone.net</a>, download the correct rpm package and install with the command:</p><p><em>rpm -ivh mpg123-RELEASE_NUMBER.rpm</em></p><p>Where RELEASE_NUMBER is the actual release number you download.</p><p>Once installed you are ready to go.</p><p>With the wav files located in a directory change to that directory to run the command. The format of the command will be:</p><p>mpg123 -w file.wav file.mp3</p><p>The &#8220;-w&#8221; argument tells mpg123 that the output will be in the .wav format. The first file name is the output file name which is user configurable. A word of warning, spaces in file names aren&#8217;t always the best choice in the Linux operating system. If you want to separate words in a file name you can use &#8220;_&#8221; character. So creating a .wav of Rush&#8217;s Tom Sawyer you would do something like:</p><p>mpg123 -w Rush_Tom_Sawyer.wav &#8220;01 &#8211; Tom Sawyer.mp3&#8243;</p><p><strong>Batch Conversion</strong></p><p>What about batch conversion? This requires a bit of shell scripting. Create a Music directory (in modern Linux distributions there should be one in ~/) and dump all of your mp3 files into that directory. Next, create a shell script in your favorite text editor. We&#8217;ll call that script &#8220;batch_conversion&#8221;. The contents of the script might look like:</p><p><em>#!/usr/bin/perl<br
/> </em> <em>my $dir = &#8220;~/Music&#8221;;<br
/> opendir DH, $dir or die &#8220;Can&#8217;t open  $dir: $!&#8221;;<br
/> $count2=1;<br
/> while  ($name = readdir DH) {<br
/> next unless $name =~ /\.mp3$/;<br
/> $wav=&#8221;$count2.wav&#8221;;<br
/> print &#8220;$wav\n&#8221;;<br
/> system &#8220;mpg123 -w $wav \&#8221;$name\&#8221;";<br
/> $count2++;<br
/> }</em></p><p>Once you save the file you have to give it executable permissions with the command <em>chmod u+x batch_conversion</em>. To run the command you will issue (from the directory the new file is located) <em>./batch_conversion</em>. Once you run the file you will have both the mp3 and the wav files located in the <em>~/Music</em> directory.</p><p><strong>Final Thoughts</strong></p><p>Converting mp3 files to wav files for burning audio CDs is a simple process with mpg123. There are gui tools for this job but the command line tools make for much more flexible jobs.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2008/12/19/convert-mp3-files-to-wav-files-in-linux/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
