Class: Mediainfo::AudioStream
Instance Attribute Summary
Attributes inherited from Stream
#parsed_response
Instance Method Summary
collapse
Methods inherited from Stream
#[], #[]=, create, inherited, #initialize
Instance Method Details
#mono? ⇒ Boolean
335
|
# File 'lib/mediainfo.rb', line 335
def mono?; 1 == channels; end
|
#sample_rate ⇒ Object
Also known as:
sampling_rate
300
301
302
303
304
305
306
307
308
309
310
|
# File 'lib/mediainfo.rb', line 300
def sample_rate
return unless rate = sampling_rate_before_type_cast
number = rate.gsub(/[^\d.]+/, "").to_f
number = case rate
when /KHz/ then number * 1000
when /Hz/ then number
else
raise "unhandled sample rate! please report bug!"
end
number.to_i
end
|
#stereo? ⇒ Boolean
334
|
# File 'lib/mediainfo.rb', line 334
def stereo?; 2 == channels; end
|