.ogg to .mp3
Jump to navigation
Jump to search
ogg2mp3 is a script to convert an .ogg music-file to an mp3-file
script
#!/bin/sh BASE="`echo ${1} | sed s/.ogg$//`" ARTIST="`ogginfo "${1}"|grep -i artist | awk -F = '{print $2}'`" ALBUM="`ogginfo "${1}" |grep -i album | awk -F = '{print $2}'`" TRACK="`ogginfo "${1}"|grep -i tracknumber|awk -F = '{print $2}'`" TITLE="`ogginfo "${1}" |grep -i title | awk -F = '{print $2}'`" ogg123 -q -d wav -f - "${1}" \ | lame --quiet --preset cd - "${BASE}.mp3" id3tag --artist="${ARTIST}" --album="${ALBUM}" \ --track=$TRACK --song="${TITLE}" "${BASE}.mp3"
usage
ought to be invoked like so:
find /path -name \*.ogg -exec ogg2mp3 {} \;
since it only handles one file at a time.
external links
- ogg123 vorbis-tools (www.vorbis.com)
- lame (lame.sourceforge.net)
- id3tag -- id3lib or similar tagging program (id3lib.sourceforge.net)