21 lines
419 B
Ruby
21 lines
419 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
def convert(file,filebase)
|
|
#`ffmpeg -i '#{file}' -ab 192k '#{filebase}'.mp3`
|
|
`lame -q 0 -b 192 '#{file}' '#{filebase}'.mp3`
|
|
end
|
|
|
|
dir = Dir.new(".")
|
|
|
|
while file = dir.read do
|
|
reg = /(m4a|ogg|wav)/i
|
|
puts reg
|
|
|
|
if file.match(reg)
|
|
filebase = File.basename(file, "." + file.match(reg).to_s)
|
|
convert(file, filebase)
|
|
else
|
|
puts "Keine passende Datei gefunden: m4a, ogg, wav. "
|
|
end
|
|
end
|