The easiest way in Debian to get an mp3 encoder is to add the debian-multimedia repos and install lame (or whatever you like) from there. It's still free software.
My method for converting any audio file to mp3:
Install gstreamer-tools, good bad and ugly plug-ins, and gstreamer0.10-lame
- Code: Select all
# mp3gst.sh converts to mp3 any audio file supported by gstreamer
for TRACK in "$@" ; do
MP3OUT=$(ls "$TRACK" |sed 's/\(.*\)\..*/\1/')
gst-launch filesrc location="$TRACK" ! decodebin! audioconvert ! \
lame name=enc vbr=4 vbr-quality=4 ! xingmux ! id3mux ! \
# mode=4 means joint-stereo (default)
# vbr=4 means use new lame settings
# vbr-quality means 0 best to 9 worst - you can change this as you like.
# id3mux means use default id3v2.3
# use gst-inspect-0.10 lame for lame options
# use gst-inspect-0.10 id3mux for id3mux options
So just run `mp3gst.sh <file>` or `mp3gst.sh <file> <file> <file>` for multiple files.
For a better batch audio conversion try pacpl or try another gstreamer based script http://forums.debian.net/viewtopic.php?p=290942#p290942
convert directories of almost any music files to oggvorbis
or mp3. It uses gstreamer so it can decode any file that gstreamer
can decode, including aac,flac,wv,ape,mp3,ogg,oga,wma,mpc,m4a etc
The new files are created in a new directory of the same name as the
original, in a destination of your choice. If no destination is chosen
then the new directory is nested within the original. All metadata is
retained. This includes the usual tags and also cover art and
replaygain tags. If the source files do not have replaygain tags then
it can run replaygain on the new files.
Any images (jpg,tif,bmp,png etc) in the source directory are also
copied over. Finally a simple playlist is written.