Skip to content

Instantly share code, notes, and snippets.

@joesepi
Last active April 27, 2018 08:12
Show Gist options
  • Save joesepi/c383b7cbcb41214c5c55227808175459 to your computer and use it in GitHub Desktop.
Save joesepi/c383b7cbcb41214c5c55227808175459 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
	/usr/local/bin/ffmpeg -i "$f" "${f/m4a/mp3}"
done
@goneng
Copy link

goneng commented Apr 27, 2018

Hey, great hack!

A poor-man's pull-request:
Please consider adding some defensive programing to the Automator Workflow,
as in my fork -
https://gist.github.com/goneng/7169ad93053a07e4015572a49808486c/revisions?diff=unified

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment