Skip to content

Instantly share code, notes, and snippets.

@stellard
Created April 5, 2012 22:59
Show Gist options
  • Save stellard/2314845 to your computer and use it in GitHub Desktop.
Save stellard/2314845 to your computer and use it in GitHub Desktop.
Convert music files
#!/usr/bin/ruby
require 'rubygems'
dir = ARGV.first
unless dir
puts "must supply a directory" unless dir
puts "USAGE:"
puts "music_convert directory"
exit 1
end
dir = "#{dir}/**/*.wma".gsub('//','/')
Dir[dir].each do |file|
destination = file.gsub(/\.wma$/, '.mp3')
unless File.exists? destination
puts "ffmpeg -i '#{file}' '#{destination}'"
system "ffmpeg -i '#{file}' '#{destination}'"
end
end
@nicole-701
Copy link

Want to know how to convert Spotify music to mp3: https://musicfab.org/convert-spotify-to-mp3

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