Skip to content

Instantly share code, notes, and snippets.

@goneng
Forked from joesepi/Converting m4a to mp3.md
Last active April 27, 2018 07:48
Show Gist options
  • Save goneng/7169ad93053a07e4015572a49808486c to your computer and use it in GitHub Desktop.
Save goneng/7169ad93053a07e4015572a49808486c to your computer and use it in GitHub Desktop.
Ways to convert m4a to mp3 on Mac/Unix

Add this to your .profile (or whatever)

# convert files in directory from m4a to mp3
function m4a() {
  find . -iname '*.m4a' -exec bash -c 'ffmpeg -i "$1" "${1/m4a/mp3}"' -- {} \;
}

To setup a Service (contextual menu), create an Automator 'Workflow'

use Run Shell Script (bash / pass in as arguments)

for f in "$@"
do
	if [[ $f == *.m4a ]]
	then
		/usr/local/bin/ffmpeg -i "$f" "${f/m4a/mp3}"
	fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment