Convert M4A to MP3

From Tomp Online Wiki

Jump to: navigation, search

Introduction

My MP3 player does not play the music files that come from Apple IStore, so to convert them to MP3 use this little script:

First get the decoder and the encoder:

yum install faad2 lame

Now create this script and run it inside a directory of files:

#!/bin/sh
for i in *.m4a; do
  faad "$i"
  src=`echo "$i"|sed -e 's/.m4a/.wav/'`
  dst=`echo "$i"|sed -e 's/.m4a/.mp3/'`
  lame --preset medium "$src" "$dst"
  rm "$src"
done
Personal tools