Search This Blog

Tuesday, March 06, 2007

convert mp3 to wav

place the following script in ~/bin and call it mp3towav.

guest@kusumanchi:~/bin$ cat mp3towav
#! /bin/sh

# bash script to convert .mp3 files to .wav files
# works even if the files have spaces in their names.
#
# Author : Kamaraju Kusumanchi
# Email : kamaraju at gmail dot com
#
# Usage : cd into the directory containing .mp3 files and then execute
# this.
#
# Ref :- Linux Multimedia Hacks, Tips & Tools for Taming Images, Audio and
# Video by Kyle Rankin, pg-100
#

for i in *.mp3; do
lame --decode "$i" "`basename "$i" .mp3`".wav
done
Make the script executable
guest@kusumanchi:~/bin$ chmod +x mp3towav
guest@kusumanchi:~/bin$ ls -al mp3towav
-rwxr-xr-x 1 guest guest 450 2007-03-06 20:19 mp3towav
Cd into the directory containing .mp3 files
guest@kusumanchi:~/bin$ cd /entertainment/telugu_songs/godavari/
guest@kusumanchi:/entertainment/telugu_songs/godavari$ ls -1 *mp3
01 - Ramachakkani Sitaki.mp3
02 - Uppongele Godavari.mp3
03 - Manasavacha.mp3
04 - Manasaa Gelupu.mp3
05 - Tippulu Tappulu.mp3
06 - Andamgaalena.mp3
Run the script
guest@kusumanchi:/entertainment/telugu_songs/godavari$ ~/bin/mp3towav
There will be messages such as
ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding.
input: 01 - Ramachakkani Sitaki.mp3
(44.1 kHz, 2 channels, MPEG-1 Layer III)
output: 01 - Ramachakkani Sitaki.wav (16 bit, Microsoft WAVE)
skipping initial 1105 samples (encoder+decoder delay)
Frame# 8878/8859 128 kbps L R
The corresponding .wav files will be created once the script completes. The .mp3 files are unmodified.
guest@kusumanchi:/entertainment/telugu_songs/godavari$ ls -1 *wav
01 - Ramachakkani Sitaki.wav
02 - Uppongele Godavari.wav
03 - Manasavacha.wav
04 - Manasaa Gelupu.wav
05 - Tippulu Tappulu.wav
06 - Andamgaalena.wav
Programs like k3b can now be used to burn these wave files onto a CD/DVD.

2 comments:

Author said...

Thanks for the post..
Here is online free mp3 to wav converter
convert mp3 to wav

Kamaraju Kusumanchi said...

The website does not load. What is the advantage of using this compared to lame? Is it open source? I will be deleting the comment if there are no relative advantages.

Blog Archive

Followers