Skip to content

Instantly share code, notes, and snippets.

@ideaoforder
Created May 16, 2011 20:52
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ideaoforder/975354 to your computer and use it in GitHub Desktop.
Ruby script to convert dir of mp3s to oggs
#!/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!"
@sergiotapia
Copy link

Thanks for sharing, helped me out big time!

@NarekChang
Copy link

Please, tell me how i can convert dir of oggs to mp3s

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