I live in Omaha.
 
Navigation
 
Search
 
Random Image
DSC_0013.jpg
 
Me. Elsewhere.
 
Archives
 
Darcy
 
Recently Read
 
Things I Like
git
 
License
 
m4a2mp3

I had some m4a encoded files I wanted in mp3 (don’t judge me) so I cooked up a modified script from one found here, that does the trick.

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
#
# m4a2mp3
#
for i in *.m4a; do
  mplayer -vc null -vo null -ao pcm:fast "$i" -ao pcm:file="${i%.m4a}.wav"
done
for i in *.wav; do
  lame -h -V2 --vbr-new "$i" "$(i%.wav}.mp3"
done
 
rm *.wav

Update (06/19/07)
Just a quick note, you can use this to convert any supported audio file by replacing all the m4a with the correct extension. E.G. For flac replace m4a with fla. A nice little vim command for that would be :%s/m4a/fla/g
Update (03/18/08)
I posted a version to go from anything (that mplayer can play) to mp3 without editing the script. Check it out here.
Posted June 4th, 2007 - Permalink
Categories: Geek
Tags: , , , ,
You can leave a comment, or trackback from your own site.
 
Possibly Related Posts
 
Adjacent Posts
 
Comments

One Response to “m4a2mp3”

  1. VelvetCache.org » John Hobbs Blog » Blog Archive » any2mp3 Says:

    [...] a modification of a bash script I made a while back to convert anything that mplayer can play into an mp3 file. Change bitrates and the like to [...]

 
Copyright © 2006 - 2010 John Hobbs
get userping