class AudioAnalyzer
Ruby on Rails 8.0.4
Since v7.0.10Active Storage Audio Analyzer
Extracts duration (seconds), bit_rate (bits/s), sample_rate (hertz) and tags (internal metadata) from an audio blob.
Example:
ActiveStorage::Analyzer::AudioAnalyzer.new(blob).metadata # => { duration: 5.0, bit_rate: 320340, sample_rate: 44100, tags: { encoder: "Lavc57.64", ... } }
This analyzer requires the FFmpeg system library, which is not provided by Rails.
Inherits from
Methods (defined here)
Private methods
(9)
Implementation detail — not part of the public API.
- # audio_stream
- # bit_rate
- # duration
- # ffprobe_path
- # probe
- # probe_from
- # sample_rate
- # streams
- # tags
Methods (inherited)
From ActiveStorage::Analyzer (4)
- # metadata
- self. accept?
- self. analyze_later?
- self. new
From Object (17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # with
- # with_options
From ActiveSupport::NumericWithFormat (2)
- # to_formatted_s
- # to_fs