<?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>Random Wisdom &#187; mp3</title>
	<atom:link href="http://scrolls.mafgani.net/tag/mp3/feed/" rel="self" type="application/rss+xml" />
	<link>http://scrolls.mafgani.net</link>
	<description>An attempt at organizing my thoughts ...</description>
	<lastBuildDate>Sun, 13 Mar 2011 22:54:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Re-encoding MP3 files using LAME</title>
		<link>http://scrolls.mafgani.net/2008/06/re-encoding-mp3-files-using-lame/</link>
		<comments>http://scrolls.mafgani.net/2008/06/re-encoding-mp3-files-using-lame/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 14:41:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[lame]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[transcoding]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=99</guid>
		<description><![CDATA[I have some MP3 files encoded at a constant bitrate of 320kbps that my phone seems to have trouble playing smoothly. So, I looked into LAME. The files I had were named using the following scheme: 01 - Title of track 01.mp3 02 - Title of track 02.mp3 ... I used the BASH for-loop construct [...]]]></description>
			<content:encoded><![CDATA[<p>I have some MP3 files encoded at a constant bitrate of 320kbps that my phone seems to have trouble playing smoothly. So, I looked into <a href="http://en.wikipedia.org/wiki/LAME">LAME</a>.</p>
<p>The files I had were named using the following scheme:</p>
<pre>
01 - Title of track 01.mp3
02 - Title of track 02.mp3
...
</pre>
<p>I used the BASH <span style="font-family: courier new;">for-loop</span> construct to process the files:</p>
<pre>
$ for A in *.mp3;\              # Process one mp3 at a time
  do B=${A%.mp3};\              # Extract track number and title
     C=${B#?? -};\              # Extract the title
     D=${B%% - *};\             # Extract the track number
     lame --vbr-new -V0 -q0\    # Variable-bitrate, high-quality
          --mp3input\           # Inputs are MP3 files
          --tt "$C"\            # ID3v2 tags: title
          --ta 'Artist Name'\   # ID3v2 tags: artist
          --tl 'Album Title'\   # ID3v2 tags: album
          --ty 2007\            # ID3v2 tags: year
          --tn "$D"\            # ID3v2 tags: track no.
          --tg 'GENRE'\         # ID3v2 tags: genre
          "$A" processed/"$A";\ # Keep filename and save in ./processed/
  done
</pre>
<p>Since no bit-rate bounds are explicitly provided, the re-encoded files can contain anything between 32kbps and 320kbps. The LAME man-page provides an extensive list of options and their meanings.</p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2008/06/re-encoding-mp3-files-using-lame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

