I'm writing an audio encoding application, I need to encode wav files to
mp3 and mp4. I have managed the mp3 part using the lamer gem: http://rubygems.org/gems/lamer
I am now looking to encode wav to mp4/aac i think i need to use the nero
encoder for this http://www.nero.com/eng/downloads-nerodigital-nero-aac-codec.php does
anyone know if there is a ruby gem that would allow me to do this?
If you used ffmpeg you wouldn't need different tools to convert to
different formats, so your program would have fewer dependencies.
Once I needed just to convert some files so I did something like:
# Not tested any of this tiny and flawed program
···
#
# Convert the file specified by path to a different multimedia format
def convert path, type
`ffmpeg -i #{in_file} #{in_file}.#{type}`
end
convert "Rebecca Black - Friday.ogg", "mp3"
# That writes out to 'Rebecca Black - Friday.ogg.mp3'
This approach of calling the command line application probably isn't so
great if you were writing a big fancy program but it worked okay for my
little use case.