R2mp3 is a ruby library that makes audio converting to mp3 fairly easy.
Currently, support formats are following:
- wma
- aac
- aif
- au
- flac
- ogg
- ra
INSTALLATION
#Software requirement
1. install lame and mplayer in the box.
(OSX)
sudo port intall lame
sudo port install mplayer
(Debian, Ubuntu, etc.)
sudo apt-get install lame
sudo apt-get install mplayer
2. install gem
sudo gem install r2mp3
HOW TO USE
#Converter
#handle all objects which is convertable to mp3
converter = R2mp3::Converter.new(:in => "/path/to/file", :out => "/path/to/file")
#options :mode => "stereo", :bitrate => ""
converter.to_mp3 # true or false
converter.to_mp3! # true if sucess, otherwise raise Exception
#Inspector
file = R2mp3::Inspector.new(:file => "/path/to/mp3_file")
file.type
file.bitrate
file.samplerate
#for more detail, see in spec/
Currently, support formats are following:
- wma
- aac
- aif
- au
- flac
- ogg
- ra
INSTALLATION
#Software requirement
1. install lame and mplayer in the box.
(OSX)
sudo port intall lame
sudo port install mplayer
(Debian, Ubuntu, etc.)
sudo apt-get install lame
sudo apt-get install mplayer
2. install gem
sudo gem install r2mp3
HOW TO USE
#Converter
#handle all objects which is convertable to mp3
converter = R2mp3::Converter.new(:in => "/path/to/file", :out => "/path/to/file")
#options :mode => "stereo", :bitrate => ""
converter.to_mp3 # true or false
converter.to_mp3! # true if sucess, otherwise raise Exception
#Inspector
file = R2mp3::Inspector.new(:file => "/path/to/mp3_file")
file.type
file.bitrate
file.samplerate
#for more detail, see in spec/