Class: VCSRuby::FFmpegAudioStream
- Inherits:
-
Object
- Object
- VCSRuby::FFmpegAudioStream
- Defined in:
- lib/FFmpeg/ffmpeg_audio_stream.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #bit_rate ⇒ Object
- #channel_layout ⇒ Object
- #channels ⇒ Object
- #codec(short = false) ⇒ Object
-
#initialize(audio_stream) ⇒ FFmpegAudioStream
constructor
A new instance of FFmpegAudioStream.
- #sample_rate ⇒ Object
Constructor Details
#initialize(audio_stream) ⇒ FFmpegAudioStream
Returns a new instance of FFmpegAudioStream.
10 11 12 |
# File 'lib/FFmpeg/ffmpeg_audio_stream.rb', line 10 def initialize audio_stream @raw = audio_stream end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
8 9 10 |
# File 'lib/FFmpeg/ffmpeg_audio_stream.rb', line 8 def raw @raw end |
Instance Method Details
#bit_rate ⇒ Object
34 35 36 |
# File 'lib/FFmpeg/ffmpeg_audio_stream.rb', line 34 def bit_rate @raw['bit_rate'].to_i end |
#channel_layout ⇒ Object
26 27 28 |
# File 'lib/FFmpeg/ffmpeg_audio_stream.rb', line 26 def channel_layout @raw['channel_layout'] end |
#channels ⇒ Object
22 23 24 |
# File 'lib/FFmpeg/ffmpeg_audio_stream.rb', line 22 def channels @raw['channels'].to_i end |
#codec(short = false) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/FFmpeg/ffmpeg_audio_stream.rb', line 14 def codec short = false if short @raw['codec_name'] else @raw['codec_long_name'] end end |
#sample_rate ⇒ Object
30 31 32 |
# File 'lib/FFmpeg/ffmpeg_audio_stream.rb', line 30 def sample_rate @raw['sample_rate'].to_i end |