Class: ActiveStorage::HotCell::Client::Analyzers::Audio

Inherits:
Analyzer
  • Object
show all
Includes:
Analyzing
Defined in:
lib/active_storage/hot_cell/client/analyzers/audio.rb,
lib/active_storage/hot_cell/client/analyzers/audio/ffprobe.rb

Overview

Rails' AudioAnalyzer, moved to the cell the way the video analyzer is.

Rails' audio keys, minus tags: Rails writes raw container metadata into the database, and the cell refuses it because those bytes are attacker-controlled.

Defined Under Namespace

Classes: Ffprobe

Constant Summary collapse

KEYS =
%i[ duration bit_rate sample_rate ].freeze
FFprobe =
Ffprobe

Class Method Summary collapse

Methods included from Analyzing

included, #metadata

Class Method Details

.accept?(blob) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/active_storage/hot_cell/client/analyzers/audio.rb', line 21

def self.accept?(blob)
  blob.audio?
end