#!/bin/sh # Generate cdrdao-toc-file with CD-Text from .wav files with # name-format "Interpret - Titel.wav" # mp3id2toc tocfile [mp3dir] idtemp=/tmp/myid3tag if ! test "$1"; then echo " mp3id2toc: Erzeugen einer TOC mit CD-Text aus den ID-Tags der, in einem Verzeichnis enthaltenen MP3-Dateien. Benutzung: mp3id2toc tocfile [mp3dir] tocfile: Dateiname der TOC mp3dir: Verzeichnis, in dem die MP3-Dateien stehen (default: .) " exit fi tocfile="$1" mp3dir=. if test "$2"; then if ! test -d "$2"; then echo "MP3-Verzeichnis $2 existiert nicht !" exit fi mp3dir="$2" fi #echo "Dir:$mp3dir| - Toc:$tocfile|" discid=`cdrdao 2>&1 | grep -i "cdrdao version" | cut -d ' ' -f 1-3`", "`date` cd "$mp3dir" for file in *.mp3 do myfile=$file done file=$myfile id3v2 -l "$file" > $idtemp #interpret=$(grep "TP1" $idtemp | awk -F: '{print $2}' | sed "s/^ *//g") interpret=$(grep "TPE1" $idtemp | awk -F: '{print $2}' | sed "s/^ *//g") #album=$(grep "TAL" $idtemp | awk -F: '{print $2}' | sed "s/^ *//g") album=$(grep "TALB" $idtemp | awk -F: '{print $2}' | sed "s/^ *//g") echo echo Erzeuge cddao-toc-Datei aus mp3-Dateien im Verzeichnis: echo $mp3dir echo echo Interpret:$interpret - Titel:$album echo ========================================= cat >$tocfile << EOF CD_DA CD_TEXT { LANGUAGE_MAP { 0 : EN } LANGUAGE 0 { TITLE "$album" DISC_ID "$discid" PERFORMER "$interpret" UPC_EAN "" ISRC "" } } EOF ind=0 for file in *.mp3 do [ -e "$file" ] || continue id3v2 -l "$file" > $idtemp titel=$(grep "TIT2" "$idtemp" | awk -F: '{print $2}' | sed "s/^ *//g") interpret=$(grep "TPE1" "$idtemp" | awk -F: '{print $2}' | sed "s/^ *//g") ind=$(($ind+1)) echo Track:$ind - Titel: "$titel" - Interpret: "$interpret" wavefile=`basename "$file" .mp3`.wav cat >>$tocfile <