public
Created

Ruby script to convert dir of mp3s to oggs

  • Download Gist
mp32ogg.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/env ruby
require 'rubygems'
 
@dir = ARGV[0]
@i = 0
Dir.glob("#{@dir}/*.mp3").each do |mp3|
ogg = mp3.gsub('mp3', 'ogg')
system "ffmpeg -i \"#{mp3}\" -acodec libvorbis -ac 2 \"#{ogg}\""
@i += 1
end
puts "Converted #{@i} mp3s to ogg format!"

Thanks for sharing, helped me out big time!

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.