Class: ActiveStorage::Analyzer::AudioAnalyzer
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
| Class Chain: | |
| Instance Chain: | |
| Inherits: | ActiveStorage::Analyzer 
 | 
| Defined in: | activestorage/lib/active_storage/analyzer/audio_analyzer.rb | 
Overview
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).
# => { 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.
Class Attribute Summary
::ActiveStorage::Analyzer - Inherited
| .analyze_later? | Implement this method in concrete subclasses. | 
Class Method Summary
::ActiveStorage::Analyzer - Inherited
Instance Attribute Summary
::ActiveStorage::Analyzer - Inherited
Instance Method Summary
::ActiveStorage::Analyzer - Inherited
| #metadata | Override this method in a concrete subclass. | 
| #download_blob_to_tempfile | Downloads the blob to a tempfile on disk. | 
| #instrument, #logger, #tmpdir | |
Constructor Details
This class inherits a constructor from ActiveStorage::Analyzer
Class Method Details
    .accept?(blob)  ⇒ Boolean 
  
Instance Method Details
#metadata
[ GitHub ]# File 'activestorage/lib/active_storage/analyzer/audio_analyzer.rb', line 19
def { duration: duration, bit_rate: bit_rate, sample_rate: sample_rate, tags: }.compact end