Created
November 25, 2015 19:17
-
-
Save garrettheaver/284e000e867b56d3722d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
$stdin.each_line do |line| | |
path = line.chomp | |
base = File.basename(path, '.m4a') | |
name = File.join(File.dirname(path), "#{base}.mp3") | |
next if File.exists?(name) | |
cmd = %(ffmpeg -i "#{path}" -acodec libmp3lame -ab 160k "#{name}" < /dev/null) | |
puts cmd | |
puts system(cmd) rescue nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment