Skip to content

Instantly share code, notes, and snippets.

@aisuii
Created December 6, 2011 18:02
Show Gist options
  • Save aisuii/1439199 to your computer and use it in GitHub Desktop.
Save aisuii/1439199 to your computer and use it in GitHub Desktop.
KASUI m4a to mp3
# coding: utf-8
Dir['*.m4a'].each do |m4a|
mp3 = File.basename(m4a, '.m4a') + '.mp3'
cmd = "ffmpeg -i '#{m4a}' -acodec libmp3lame -ab 320 -ac 2 '#{mp3}'"
puts cmd
`#{cmd}`
end
#!/bin/sh
for m4a in "$@"
do
title=`basename "$m4a" .m4a`
ffmpeg -i "$m4a" -acodec libmp3lame -ab 320 -ac 2 "$title".mp3
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment