[Vorbis] Q: Tool to copy Vorbis comments to MP3 ID tags

Frédéric Bastien nouiz at nouiz.org
Thu Mar 8 09:34:54 PST 2007


Hi,

here is a script in bash that will run on cygwin or linux that do it. It 
need the application metaflac and id3v2. It take two parameter, the 
first one is the flac file and the second is the mp3 file.

Hope this help

Frédéric Bastien
---begin after this line---
#!/bin/bash

SOURCE=$1
OUTF=$2

ID3=id3v2
ARTIST=`metaflac "$SOURCE" --show-tag=ARTIST | sed s/.*=//g`
TITLE=`metaflac "$SOURCE" --show-tag=TITLE | sed s/.*=//g`
ALBUM=`metaflac "$SOURCE" --show-tag=ALBUM | sed s/.*=//g`
GENRE=`metaflac "$SOURCE" --show-tag=GENRE | sed s/.*=//g`
TRACKNUMBER=`metaflac "$SOURCE" --show-tag=TRACKNUMBER | sed s/.*=//g`
TRACKTOTAL=`metaflac "$SOURCE" --show-tag=TRACKTOTAL | sed s/.*=//g`
YEAR=`metaflac "$SOURCE" --show-tag=DATE | sed s/.*=//g | cut -b -4`

if test "x$TITLE" != "x"; then
     $ID3 --song="$TITLE" "$OUTF" > /dev/null
fi

if test "x$TRACKNUMBER" != "x"; then
     $ID3 --track="$TRACKNUMBER" "$OUTF" > /dev/null
fi

if test "x$TRACKTOTAL" != "x"; then
     $ID3 -T "$TRACKTOTAL" "$OUTF" > /dev/null
fi

if test "x$ARTIST" != "x"; then
     $ID3 --artist="$ARTIST" "$OUTF" > /dev/null
fi

if test "x$ALBUM" != "x"; then
     $ID3 --album="$ALBUM" "$OUTF" > /dev/null
fi

if test "x$GENRE" != "x"; then
     $ID3 --genre="$GENRE" "$OUTF" > /dev/null
fi

if test "x$YEAR" != "x"; then
     $ID3 -year="$YEAR" "$OUTF" > /dev/null
fi


More information about the Vorbis mailing list