In this article i am going to describe how can u use ur own Linux box to convert any format audio to mp3, and that too without violating any copyright laws!!!
what u need?
mplayer //as usual, i always play with it!
lame (lame ain't an mp3 encoder) // but it is
bas!!!
mplayer, i have already described how to get it, and for lame get it from lame.sourceforge.net, it has no dependency.
Now,
The process is divided into 2 stages.
1. Converting ur music to wave. say u have a file called music.wma, let us convert this...
mplayer -ao pcm music.wma
This will produce an output file named audiodump.wav in the same dir
2. Convert this audiodump.wav to mp3, say at bitrate=128
lame -V2 -b 128 audiodump.wav music.mp3
Finished in 30secs approx................
Now the fun part........... Automate the process. I have done that already...
Here is the script..........
> #!/bin/bash
> # call this file convert2mp3
> if [ $# -lt 3 ]
> then
> echo Usage: $0 bitrate input output
> exit
> fi
>
> if [ -f audiodump.wav ]
> then
> echo -n "File named audiodump.wav exists. Remove? (y/n): "
> read x
> if [ $x = "n" ]
> then
> exit
> fi
> fi
>
>
> if [ `mplayer > /dev/null` ]
> then
> echo "Needs mplayer and lame to execute!"
> fi
>
> if [ `lame --help > /dev/null` ]
> then
> echo "Needs lame and mplayer to execute!"
> fi
>
> mplayer $2 -ao pcm
> lame -V2 -b $1 audiodump.wav $3
>
> if [ $? = 0 ]
> then
> echo "Finished Sucessfully!!!"
> fi
>
> rm audiodump.wav -f
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment