Module: AudioRating::ID3v2
- Defined in:
- lib/audio_rating/id3v2.rb
Overview
Base class for ID3v2 tags, used by AIFF, MP3 and WAV files.
Class Method Summary collapse
-
.get(tag) ⇒ Integer, ...
Get an ID3v2 tag’s star-rating metadata if present.
Class Method Details
.get(tag) ⇒ Integer, ...
Get an ID3v2 tag’s star-rating metadata if present.
Uses taglib-ruby class: rubydoc.info/gems/taglib-ruby/TagLib/ID3v2/PopularimeterFrame
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/audio_rating/id3v2.rb', line 16 def self.get(tag) popm_frames = tag.frame_list 'POPM' return if popm_frames.empty? popm_frames.each do |frame| = POPM_VALUE_TO_STAR_RATING[frame.] ||= RATE_VALUE_TO_STAR_RATING[frame.] return if end end |