Class: FormatParser::Audio
- Inherits:
-
Object
- Object
- FormatParser::Audio
- Includes:
- AttributesJSON
- Defined in:
- lib/audio.rb
Constant Summary collapse
- NATURE =
:audio
Instance Attribute Summary collapse
-
#audio_sample_rate_hz ⇒ Object
The sample rate of the audio file in hertz, as an Integer.
-
#format ⇒ Object
Type of the file (e.g :mp3).
-
#intrinsics ⇒ Object
If a parser wants to provide any extra information to the caller it can be placed here.
-
#media_duration_frames ⇒ Object
Duration of the media object in addressable frames or samples, as an Integer.
-
#media_duration_seconds ⇒ Object
Duration of the media object (be it audio or video) in seconds, as a Float.
-
#num_audio_channels ⇒ Object
The number of audio channels for sound files that are muxed and for video files with embedded sound.
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Audio
constructor
Only permits assignments via defined accessors.
- #nature ⇒ Object
Methods included from AttributesJSON
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_hz ⇒ Object
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 |
#format ⇒ Object
Type of the file (e.g :mp3)
8 9 10 |
# File 'lib/audio.rb', line 8 def format @format end |
#intrinsics ⇒ Object
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_frames ⇒ Object
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_seconds ⇒ Object
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_channels ⇒ Object
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
#nature ⇒ Object
34 35 36 |
# File 'lib/audio.rb', line 34 def nature NATURE end |