Class: FormatParser::Audio

Inherits:
Object
  • Object
show all
Includes:
AttributesJSON
Defined in:
lib/audio.rb

Constant Summary collapse

NATURE =
:audio

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttributesJSON

#as_json, #to_json

Constructor Details

#initialize(**attributes) ⇒ Audio

Only permits assignments via defined accessors



30
31
32
# File 'lib/audio.rb', line 30

def initialize(**attributes)
  attributes.map { |(k, v)| public_send("#{k}=", v) }
end

Instance Attribute Details

#audio_sample_rate_hzObject

The sample rate of the audio file in hertz, as an Integer



15
16
17
# File 'lib/audio.rb', line 15

def audio_sample_rate_hz
  @audio_sample_rate_hz
end

#formatObject

Type of the file (e.g :mp3)



8
9
10
# File 'lib/audio.rb', line 8

def format
  @format
end

#intrinsicsObject

If a parser wants to provide any extra information to the caller it can be placed here



27
28
29
# File 'lib/audio.rb', line 27

def intrinsics
  @intrinsics
end

#media_duration_framesObject

Duration of the media object in addressable frames or samples, as an Integer



23
24
25
# File 'lib/audio.rb', line 23

def media_duration_frames
  @media_duration_frames
end

#media_duration_secondsObject

Duration of the media object (be it audio or video) in seconds, as a Float



19
20
21
# File 'lib/audio.rb', line 19

def media_duration_seconds
  @media_duration_seconds
end

#num_audio_channelsObject

The number of audio channels for sound files that are muxed and for video files with embedded sound



12
13
14
# File 'lib/audio.rb', line 12

def num_audio_channels
  @num_audio_channels
end

Instance Method Details

#natureObject



34
35
36
# File 'lib/audio.rb', line 34

def nature
  NATURE
end