Created
May 21, 2011 23:40
-
-
Save micahbrich/985006 to your computer and use it in GitHub Desktop.
Batch convert flac to mp3, with metadata, using ffmpeg
This file contains 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
Dir.glob("*.flac").each do |f| | |
flac = "./#{f.gsub(' ', '\ ')}" | |
mp3 = "./#{f.gsub(' ', '\ ').chomp('.flac')}.mp3" | |
system("ffmpeg -i #{flac} -map_meta_data #{mp3}:#{flac} #{mp3}") | |
end |
This file contains 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
Dir["*.mp3"].each do |file| | |
puts "\rConverting #{file}..." | |
file = file.chomp(".mp3") | |
`ffmpeg -i '#{file}.mp3' '#{file}.wav'` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment