Skip to content

Instantly share code, notes, and snippets.

@pshchelo
Created April 12, 2015 09:32
Show Gist options
  • Save pshchelo/f8baf44221d698d0dcb8 to your computer and use it in GitHub Desktop.
Save pshchelo/f8baf44221d698d0dcb8 to your computer and use it in GitHub Desktop.
cli transcode mp3 to aac with NeroAAC
for f in *.mp3
do
OUTF=`echo "$f" | sed s/\.mp3$/.aac/g`
ARTIST=`ID3 "$f" --show-tag=GENRE| sed s/.*=//g`
TITLE=`ID3 "$f" --show-tag=GENRE| sed s/.*=//g`
ALBUM=`ID3 "$f" --show-tag=GENRE| sed s/.*=//g`
GENRE=`ID3 "$f" --show-tag=GENRE | sed s/.*=//g`
TRACKTOTAL=`ID3 "$f" --show-tag=TRACKTOTAL | sed s/.*=//g`
DATE=`ID3 "$f" --show-tag=DATE | sed s/.*=//g`
TRACKNUMBER=`ID3 "$f" --show-tag=TRACKNUMBER | sed s/.*=//g`
lame --decode "$f" - | neroAacEnc -if - -cbr 320000 -of "$OUTF"
neroAacTag "$OUTF" -meta:artist="$ARTIST" -meta:title="$TITLE"
done
mkdir "$ALBUM" && mv *.aac "$ALBUM"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment