Class: Soxi::Wrapper::File

Inherits:
Object
  • Object
show all
Defined in:
lib/soxi/wrapper/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filenameObject (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_bitrateObject



40
41
42
# File 'lib/soxi/wrapper/file.rb', line 40

def average_bitrate
  @average_bitrate ||= run('B')
end

#bits_per_sampleObject



36
37
38
# File 'lib/soxi/wrapper/file.rb', line 36

def bits_per_sample
  @bits_per_sample ||= run('b').to_i
end

#channelsObject



20
21
22
# File 'lib/soxi/wrapper/file.rb', line 20

def channels
  @channels ||= run('c').to_i
end

#commentsObject



48
49
50
# File 'lib/soxi/wrapper/file.rb', line 48

def comments
  @comments ||= run_multiline('a')
end

#durationObject



28
29
30
# File 'lib/soxi/wrapper/file.rb', line 28

def duration
  @duration ||= run('d')
end

#encodingObject



44
45
46
# File 'lib/soxi/wrapper/file.rb', line 44

def encoding
  @encoding ||= run('e')
end

#filetypeObject



12
13
14
# File 'lib/soxi/wrapper/file.rb', line 12

def filetype
  @filetype ||= run('t')
end

#samplerateObject



16
17
18
# File 'lib/soxi/wrapper/file.rb', line 16

def samplerate
  @samplerate ||= run('r')
end

#samplesObject



24
25
26
# File 'lib/soxi/wrapper/file.rb', line 24

def samples
  @samples ||= run('s').to_i
end

#secondsObject



32
33
34
# File 'lib/soxi/wrapper/file.rb', line 32

def seconds
  @seconds ||= run('D').to_f
end