Project

mp3gain

0.0
No release in over a year
Takes mp3gain/aacgain binary path as an argument and offers methods to analyze and modify the track/album gain of mp3 files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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")
## optional target db and preserve timestamps
mp3gain = Mp3gain.init("aacgain", 100, preserve_timestamp: false)

# or use a chainable to
mp3gain =Mp3gain.path("path/to/MP3Gain/binary").with_target_db(100).do_preserve_timestamp(preserve: false)

# print current version
mp3gain.version 
# analyze the gain of the given files
mp3gain.analyze_gain(['path/to/file1', 'path/to/file2'])
# delete stored tag infos of the given files
mp3gain.delete_stored_tag_info(['path/to/file1', 'path/to/file2'])
# apply track gain depending on the provided target DB
mp3gain.apply_track_gain(['path/to/file1', 'path/to/file2'])
# apply album gain depending on the provided target DB
mp3gain.apply_album_gain(['path/to/file1', 'path/to/file2'])
# apply the given gain 
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.