Class: VCSRuby::LibAVAudioStream

Inherits:
Object
  • Object
show all
Defined in:
lib/libAV/libav_audio_stream.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(audio_stream) ⇒ LibAVAudioStream

Returns a new instance of LibAVAudioStream.



10
11
12
# File 'lib/libAV/libav_audio_stream.rb', line 10

def initialize audio_stream
  @raw = audio_stream
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



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

def raw
  @raw
end

Instance Method Details

#bit_rateObject



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

def bit_rate
  @raw['bit_rate'].to_i
end

#channel_layoutObject



26
27
28
# File 'lib/libAV/libav_audio_stream.rb', line 26

def channel_layout
  @raw['channel_layout']
end

#channelsObject



22
23
24
# File 'lib/libAV/libav_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/libAV/libav_audio_stream.rb', line 14

def codec short = false
  if short
    @raw['codec_name']
  else
    @raw['codec_long_name']
  end
end

#sample_rateObject



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

def sample_rate
  @raw['sample_rate'].to_i
end