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
301
|
# File 'lib/mediainfo.rb', line 301
def mono?; 1 == channels; end
|
#sample_rate ⇒ Object
Also known as:
sampling_rate
266
267
268
269
270
271
272
273
274
275
276
|
# File 'lib/mediainfo.rb', line 266
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
300
|
# File 'lib/mediainfo.rb', line 300
def stereo?; 2 == channels; end
|