Convertir archivos .flac a archivos .mp3   Leave a comment

Muchas veces he bajado archivos de sonido en formáto .flac y por alguna razón Amarok no los reconoce bien y siempre borro el script para convertirlos a Mp3 así que ésto es para evitar la fatiga y tenerlo siempre a la vista:

for a in *.flac
do
    OUTF=`echo "$a" | sed s/\.flac$/.mp3/g`

    ARTIST=`metaflac "$a" --show-tag=ARTIST | sed s/.*=//g`
    TITLE=`metaflac "$a" --show-tag=TITLE | sed s/.*=//g`
    ALBUM=`metaflac "$a" --show-tag=ALBUM | sed s/.*=//g`
    GENRE=`metaflac "$a" --show-tag=GENRE | sed s/.*=//g`
    TRACKNUMBER=`metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g`
    DATE=`metaflac "$a" --show-tag=DATE | sed s/.*=//g`

    flac -c -d "$a" | lame --noreplaygain -V0 --add-id3v2 --pad-id3v2 --ignore-tag-errors --tt "$TITLE" \
                           --tn "${TRACKNUMBER:-0}" --ta "$ARTIST" --tl "$ALBUM" --ty "$DATE" --tg "${GENRE:-12}" \
                           - "$OUTF"
    if [ "$1" ] && [ "$1" = "-d" ] && [ $? -eq 0 ]
    then
        rm "$a"
    fi
done

Espero que a alguien le sea útil también :)

Advertisement

Posted agosto 14, 2010 by Sergio D. Rodríguez Inclan in General

Deja un comentario

Fill in your details below or click an icon to log in:

Logo de WordPress.com

You are commenting using your WordPress.com account. Log Out / Cambiar )

Twitter picture

You are commenting using your Twitter account. Log Out / Cambiar )

Facebook photo

You are commenting using your Facebook account. Log Out / Cambiar )

Connecting to %s

Seguir

Get every new post delivered to your Inbox.