AudioRating
Ruby library for reading embedded star-ratings in audio files.
Supports file formats: AIFF, FLAC, M4A, MP3, Ogg and WAV.
Uses library TagLib and Ruby interface taglib-ruby.
Installation
Requires TagLib 1.11.1 or higher. Can be installed using:
apt-get install libtag1-dev # On Debian/Ubuntu
dnf install taglib-devel # On Fedora/RHEL
brew install taglib # On macOS
Install the gem using either:
bundle add audio_rating # If using bundler, also adds to Gemfile
gem install audio_rating # If not, just install
Usage
require 'audio_rating'
AudioRating.get 'Shrek (2001)/9. All Star.mp3'
# => 5
Complete library documentation is available here.
Development
Docker Compose allows easy local development on many systems.
Docker Compose setup
Build Debian-12/Ruby-3.2 container and install library gem dependencies:
docker compose build runner
Commands can then be ran inside the Docker Compose container.
Main commands
Run unit tests:
docker compose run --rm runner rake test
Check code style:
docker compose run --rm runner bundle exec rubocop
Generate documentation:
docker compose run --rm runner yard
Build gem, publish to RubyGems and push new git tag:
docker compose run --rm runner gem build audio_rating.gemspec
docker compose run --rm runner gem push audio_rating-0.1.0.gem
git tag -a v0.1.0 -m 'Initial release'