Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/public/hivemind/pmwiki.php on line 660

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/public/hivemind/pmwiki.php on line 663

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 969

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 969

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: crypt(): Supplied salt is not valid for DES. Possible bug in provided salt format. in /home/public/hivemind/pmwiki.php on line 2067

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455
the Hive Mind | Main / FLACToMP3
Recent Changes - Search:

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

the Hive Mind

PmWiki

Peak 15

edit SideBar


Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

Deprecated: Function create_function() is deprecated in /home/public/hivemind/pmwiki.php on line 455

FLACToMP3

Converting FLAC to MP3

MP3s should be encoded with LAME VBR level 0 for optimal quality. See MP3 Production.

Shell Script

The following script for UNIX / cygwin converts FLAC to MP3 files and attempts to preserve metadata. It depends on eyeD3.

The line doing the actual audio conversion is:

flac -dc "$FLAC" | lame -V0 - "$MP3"

#!/usr/bin/env bash
FLAC=$1
#MP3="${FLAC%.flac}.mp3"
MP3=$2
[ -r "$FLAC" ] || { echo can not read file "$FLAC" >&1 ; exit 1 ; } ;

TITLE=`metaflac --no-utf8-convert --show-tag=TITLE "$FLAC" | sed s/TITLE=//I`
TRACKNUMBER=`metaflac --no-utf8-convert --show-tag=TRACKNUMBER "$FLAC" | sed s/TRACKNUMBER=//I`
GENRE=`metaflac --no-utf8-convert --show-tag=GENRE "$FLAC" | sed s/GENRE=//I`
DATE=`metaflac --no-utf8-convert --show-tag=DATE "$FLAC" | sed s/DATE=//I | cut -c 1-4`
if ! [[ "$DATE" =~ ^[0-9]+$ ]] ; then
   DATE=""
fi
ARTIST=`metaflac --no-utf8-convert --show-tag=ARTIST "$FLAC" | sed s/ARTIST=//I`
ALBUM=`metaflac --no-utf8-convert --show-tag=ALBUM "$FLAC" | sed s/ALBUM=//I`

LYRICSTMP=`mktemp`
PICTURETMP=`mktemp tmp.XXXXXXXXXX.jpg`
metaflac --no-utf8-convert --show-tag=LYRICS "$FLAC" | sed s/LYRICS=//I > $LYRICSTMP
metaflac --export-picture-to=$PICTURETMP "$FLAC"

flac -dc "$FLAC" | lame -V0 - "$MP3"

eyeD3 --to-v2.3 --itunes \
-t "$TITLE" \
-n "$TRACKNUMBER" \
-G "$GENRE" \
-Y "$DATE" \
-a "$ARTIST" \
-A "$ALBUM" \
-L "::`cat $LYRICSTMP`" \
"$MP3"
[ -s $PICTURETMP ] && { eyeD3 --to-v2.3 --itunes --add-image=$PICTURETMP:FRONT_COVER: "$MP3" ; } ;
rm $PICTURETMP
rm $LYRICSTMP

Categories:

Media Production - UNIX

Edit - History - Print - Recent Changes - Search
Page last modified on May 01, 2013, at 01:54 AM