With a little side of applesauce...

Thursday, February 1, 2007

Converting mp3 lectures to wav

So, I have found that many universities are starting to post audio versions of their lectures. (Podcasting through iTunes, RAM files, or mp3). I am going on a trip tomorrow, and would like to listen to some of these lectures on my CD Player in my truck… (Old fashioned, I know ;) ). So I needed to convert these files from mp3 to wav for the trip.

I settled on UC Berkeley’s CS162 class, (on their webcasting page ), and downloaded:

Lecture: Synchronization File: 14793.mp3

Here is the command I used to convert it:

mpg123 -b 10000 -s 14973.mp3 | sox -t raw -r 8000 -s -w -c 2 - 14973.wav

The sample rate (-r 8000) is different than most examples, (-r 44100), but I used trial and error to find the right sample rate for the lecture.


speeves said...

BTW, here is a quick way to loop through a bunch of mp3 files:

for i in $(ls *.mp3 | tr -d ‘mp3′ ); do mpg123 -s ${i}mp3 | sox -t raw -r 8000 -s -w -c 2 - ${i}wav ; done

speeves said...

I ended up settling on -r 8500, so that the lectures could fit on a 700MB CD-ROM. Dr. Joseph is a bit munchkin-ized, but understandable.