class AudioAnalyzer

Ruby on Rails 8.0.4

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Active 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

ActiveStorage::Analyzer

Methods (defined here)

Private methods

(9) Implementation detail — not part of the public API.

Methods (inherited)

From ActiveStorage::Analyzer (4)
From Object (17)
From ActiveSupport::NumericWithFormat (2)

Type at least 2 characters to search.

↑↓ navigate · open · esc close