FLAC / OGG converting to MP3

Mark Janssen maniac.nl at gmail.com
Wed Sep 14 10:36:04 UTC 2005


On 9/14/05, R.L. Reingard <reingard at hispeed.ch> wrote:
> 
> hello audio geeks
> can anyone tell me how to convert filetypes, like
> 
> FLAC to MP3
> OGG to MP3

I have the Iriver N10 (or was it H10)... it doesn't do ogg... sadly ;(
So i wrote this conversion script... it may be hell on audio quality,
but i'm encoding to low-birtate anyway, since it's only for
on-the-road-listening... i keep flac+hq-oggs on the laptop for
archiving

This script is tuned/optimized for ogg-files downloaded from
allofmp3.com so you might have to make some changes in the
file-renaming part ;)


$ cat `which ogg2iriver.sh `
------------------------------------------------------
#!/bin/bash

INFILE="$1"
OUTFILE=`echo $INFILE | sed 's/.ogg$/.mp3/' | sed 's/_192_ogg_cbr_ex//'`

echo "INFILE = '$INFILE'"
echo "OUTFILE= '$OUTFILE'"

TITLE=`ogginfo "$INFILE" | grep 'title=' | awk -F= '{print $2}'`
ARTIST=`ogginfo "$INFILE" | grep 'artist=' | awk -F= '{print $2}'`
ALBUM=`ogginfo "$INFILE" | grep 'album=' | awk -F= '{print $2}'`

nice oggdec -Q -o - $INFILE | nice lame -b 112 -m j - $OUTFILE
id3v2 -a "$ARTIST" -A "$ALBUM" -t "$TITLE" -c "ogg2iriver" -y 2004 $OUTFILE
-----------------------------------------------

It requires oggdec, lame and id3v2... al in standard packages available

-- 
Mark Janssen  --  maniac(at)maniac.nl  --  pgp: 0x357D2178 |   ,''`.  | 
Unix / Linux Open-Source and Internet Consultant @ Snow.nl |  : :' :  | 
Maniac.nl      MarkJanssen.nl      NerdNet.nl      Unix.nl |  `. `'   | 
Skype: markmjanssen ICQ: 129696007 irc: FooBar on undernet |    `-    |




More information about the ubuntu-users mailing list