Class: Soxi::Wrapper::File
- Inherits:
-
Object
- Object
- Soxi::Wrapper::File
- Defined in:
- lib/soxi/wrapper/file.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #average_bitrate ⇒ Object
- #bits_per_sample ⇒ Object
- #channels ⇒ Object
- #comments ⇒ Object
- #duration ⇒ Object
- #encoding ⇒ Object
- #filetype ⇒ Object
-
#initialize(filename) ⇒ File
constructor
A new instance of File.
- #samplerate ⇒ Object
- #samples ⇒ Object
- #seconds ⇒ Object
Constructor Details
#initialize(filename) ⇒ File
Returns a new instance of File.
8 9 10 |
# File 'lib/soxi/wrapper/file.rb', line 8 def initialize filename @filename = filename end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
7 8 9 |
# File 'lib/soxi/wrapper/file.rb', line 7 def filename @filename end |
Instance Method Details
#average_bitrate ⇒ Object
40 41 42 |
# File 'lib/soxi/wrapper/file.rb', line 40 def average_bitrate @average_bitrate ||= run('B') end |
#bits_per_sample ⇒ Object
36 37 38 |
# File 'lib/soxi/wrapper/file.rb', line 36 def bits_per_sample @bits_per_sample ||= run('b').to_i end |
#channels ⇒ Object
20 21 22 |
# File 'lib/soxi/wrapper/file.rb', line 20 def channels @channels ||= run('c').to_i end |
#comments ⇒ Object
48 49 50 |
# File 'lib/soxi/wrapper/file.rb', line 48 def comments @comments ||= run_multiline('a') end |
#duration ⇒ Object
28 29 30 |
# File 'lib/soxi/wrapper/file.rb', line 28 def duration @duration ||= run('d') end |
#encoding ⇒ Object
44 45 46 |
# File 'lib/soxi/wrapper/file.rb', line 44 def encoding @encoding ||= run('e') end |
#filetype ⇒ Object
12 13 14 |
# File 'lib/soxi/wrapper/file.rb', line 12 def filetype @filetype ||= run('t') end |
#samplerate ⇒ Object
16 17 18 |
# File 'lib/soxi/wrapper/file.rb', line 16 def samplerate @samplerate ||= run('r') end |
#samples ⇒ Object
24 25 26 |
# File 'lib/soxi/wrapper/file.rb', line 24 def samples @samples ||= run('s').to_i end |
#seconds ⇒ Object
32 33 34 |
# File 'lib/soxi/wrapper/file.rb', line 32 def seconds @seconds ||= run('D').to_f end |