Skip to content

Instantly share code, notes, and snippets.

@dgrant
Created May 2, 2015 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgrant/22ffb4538019a7e2dec6 to your computer and use it in GitHub Desktop.
Save dgrant/22ffb4538019a7e2dec6 to your computer and use it in GitHub Desktop.
Convert .m4a to .mp3
#!/bin/bash
#
# Dump m4a to wav (first step in conversion)
mkdir -p output
for i in *.mp3
do
mplayer -ao pcm:file="output/${i%.mp3}.wav" "$i"
done
# Convert wav to mp3
for i in output/*.wav
do
lame --preset fast standard "$i" "${i%.wav}.mp3"
done
rm -rf output/*.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment