FLAC is Free Lossless Audio Codec. A 35 megabyte WAV file converted to FLAC will occupy about 25 megabytes. This is a good decrease in size, considering the fact that no quality is lost. But some files aren’t all about quality and thus will be much better in mp3 or even ogg. Converting these is really simple. The key to the convertion is to decode flac files back to wav and than to convert them to whatever else is that you want.
Here is an example script to convert a bunch of flac files in the directory to mp3s.
for FILE in *.flac do echo Converting $FILE # Decode FLAC back to WAV /usr/bin/flac -d "$FILE" # Save the filename without extension BASE=`basename "$FILE" .flac` # Convert resulting WAV to MP3 with variable bitrate preserving good quality /usr/bin/lame -h -V 2 "$BASE".wav "$BASE".mp3 done
/usr/bin/flac
utility is a part of Fedora Linux distribution. /usr/bin/lame
is a part of LAME project. RPMs for Fedora Linux are available from a number of repositories, such as FreshRPMs.
just what I was looking for, works great. thanks!
[1] welcome. :)
[1] Great script, as I use ctorrent to task my home Gentoo server with downloading live recordings. But for iTunes streaming and for my iPod, flac just won’t due. I should learn a little more about Bash scripting.
Perhaps you will be interested in this script,
http://github.com/tacvbo/yafla.....lac2mp3.sh
Pretty does the same as yours, works recursively, preserves extra information and store it as ID3v2 into the mp3 file.
This is much simpler:
http://lewisdiamond.blogspot.c.....o-mp3.html