Class: FormatParser::Audio
- Inherits:
-
Object
- Object
- FormatParser::Audio
- Includes:
- AttributesJSON
- Defined in:
- lib/audio.rb
Constant Summary collapse
- NATURE =
:audio
Constants included from AttributesJSON
FormatParser::AttributesJSON::MAXIMUM_JSON_NESTING_WHEN_SANITIZING
Instance Attribute Summary collapse
-
#album ⇒ Object
Album of the audio.
-
#artist ⇒ Object
Artist of the audio.
-
#audio_sample_rate_hz ⇒ Object
The sample rate of the audio file in hertz, as an Integer.
-
#content_type ⇒ Object
The MIME type of the sound file.
-
#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.
-
#title ⇒ Object
Title of the audio.
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Audio
constructor
Only permits assignments via defined accessors.
- #nature ⇒ Object
Methods included from AttributesJSON
_sanitize_json_value, #as_json, #to_json
Constructor Details
#initialize(**attributes) ⇒ Audio
Only permits assignments via defined accessors
42 43 44 |
# File 'lib/audio.rb', line 42 def initialize(**attributes) attributes.map { |(k, v)| public_send("#{k}=", v) } end |
Instance Attribute Details
#album ⇒ Object
Album of the audio
11 12 13 |
# File 'lib/audio.rb', line 11 def album @album end |
#artist ⇒ Object
Artist of the audio
14 15 16 |
# File 'lib/audio.rb', line 14 def artist @artist end |
#audio_sample_rate_hz ⇒ Object
The sample rate of the audio file in hertz, as an Integer
24 25 26 |
# File 'lib/audio.rb', line 24 def audio_sample_rate_hz @audio_sample_rate_hz end |
#content_type ⇒ Object
The MIME type of the sound file
39 40 41 |
# File 'lib/audio.rb', line 39 def content_type @content_type end |
#format ⇒ Object
Type of the file (e.g :mp3)
17 18 19 |
# File 'lib/audio.rb', line 17 def format @format end |
#intrinsics ⇒ Object
If a parser wants to provide any extra information to the caller it can be placed here
36 37 38 |
# File 'lib/audio.rb', line 36 def intrinsics @intrinsics end |
#media_duration_frames ⇒ Object
Duration of the media object in addressable frames or samples, as an Integer
32 33 34 |
# File 'lib/audio.rb', line 32 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
28 29 30 |
# File 'lib/audio.rb', line 28 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
21 22 23 |
# File 'lib/audio.rb', line 21 def num_audio_channels @num_audio_channels end |
#title ⇒ Object
Title of the audio
8 9 10 |
# File 'lib/audio.rb', line 8 def title @title end |
Instance Method Details
#nature ⇒ Object
46 47 48 |
# File 'lib/audio.rb', line 46 def nature NATURE end |