[LAU] Batch conversion from Apple AAC to mp3?

Mark Knecht markknecht at gmail.com
Sat Dec 25 16:12:03 UTC 2010


On Fri, Dec 24, 2010 at 5:37 PM, Julien Claassen <julien at c-lab.de> wrote:
> Hello Mark!
>  You can batch convert the aac files to mp3. If you directory structure is
> very consistent, you can do even the complete structure in one script. I
> thik there is a direct aac decoder, but if you don't find one or someone
> else can point you at it, mplayer will do the trick. For one directory this
> would be:
> for F in *.aac; do
>  mplayer -ao pcm:file=$F.wav $F
>  lame -h $F.wav $F.mp3;
> done
>  So in a bigger context, say you have all the albums resting in one place,
> you might pack this loop into another:
> for D in *; do
>  cd $D
>  for F in *.aac; do
>  [what you've seen before...]
>  mkdir /new/directory/$D
>  mv *.mp3 /new/directory/$d
>  rm *.wav
>  cd ..;
> done
>  NOTE: This only works, if the directories and files don't have spaces in
> them. You can usually quote the variables you use like "$D" and that should
> help. But there were some cases - and please excuse me, if I don't remember
> them right now, being late and having partied -, where even this didn't work
> correctly. Mind you, I think this was using "find" somewhere in the
> euqation.
>  If you have artist/album, you wrap the for D in * loop in another saying:
> for A in *; do
>  cd A
>  mkdir /new/directory/$A
>  for D in *; do;
>  ...
>  cd ..;
> done
>  NOTE2: You will losse the tags this way.
>  Oh and if you want to correct the filenames to not end in .aac.mp3 you can
> use mmv:
> mmv "*.aac.mp3" "#1.mp3"
>  in the for F in *.aac; do loop, as the last line. Don't forget to add the
> semicolon.
>  Sorry, if this mail was rather upside down and round and round. I am a bit
> fuzzy. Yet still I hope, that I could be of some assistence.
>  Kindly yours
>          Julien

Wow Julien! Thanks. Basically woke up and got an early Christmas
present. Thanks!

Lots to think about. Basically, I have a Roku Netflix player that has
a special plugin that will stream my iTunes library to the home
theater system. Problem is there isn't an AAC decoder on the Roku so
currently it only works for mp3 or (I think) wave files. If I can
convert the library correctly then the family can listen to my library
instead of just me.

Problem is I think the tags have to be retained or iTunes isn't going
to tell the Roku what the songs are called, etc.

Time to maybe create a small library copy and do some scripting based
on your inputs. Thanks!

Cheers,
Mark


More information about the Linux-audio-user mailing list