RubyMp3gain
RubyMP3Gain is an Mp3Gain wrapper written in Ruby. Works also with e.g. aacgain for Mac OSX.
Installation
from rubygems using
gem install mp3gain
or from the sources using
gem build mp3gain.gemspec
And then execute:
$ gem install mp3gain-1.0.0.gem
Usage
require 'mp3gain'
mp3gain = Mp3gain.init("path/to/MP3Gain/binary")
mp3gain = Mp3gain.init("aacgain", 100, preserve_timestamp: false)
mp3gain =Mp3gain.path("path/to/MP3Gain/binary").with_target_db(100).do_preserve_timestamp(preserve: false)
mp3gain.version
mp3gain.analyze_gain(['path/to/file1', 'path/to/file2'])
mp3gain.delete_stored_tag_info(['path/to/file1', 'path/to/file2'])
mp3gain.apply_track_gain(['path/to/file1', 'path/to/file2'])
mp3gain.apply_album_gain(['path/to/file1', 'path/to/file2'])
mp3gain.add_gain(['path/to/file1', 'path/to/file2'], 5)
License
The gem is available as open source under the terms of the MIT License.