Class: Sound::Format

Inherits:
Object
  • Object
show all
Includes:
FormatLibrary
Defined in:
lib/sound/format.rb

Constant Summary

Constants included from FormatLibrary

Sound::FormatLibrary::DEFAULT_FORMAT

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type = FormatLibrary::DEFAULT_FORMAT) ⇒ Format

Returns a new instance of Format.



9
10
11
12
13
14
15
# File 'lib/sound/format.rb', line 9

def initialize(type = FormatLibrary::DEFAULT_FORMAT)
  @channels = 1
  @sample_rate = 44100
  @bits_per_sample = 16
  @type = type
  new_format
end

Instance Attribute Details

#bits_per_sampleObject Also known as: bps

Returns the value of attribute bits_per_sample.



7
8
9
# File 'lib/sound/format.rb', line 7

def bits_per_sample
  @bits_per_sample
end

#channelsObject

Returns the value of attribute channels.



7
8
9
# File 'lib/sound/format.rb', line 7

def channels
  @channels
end

#sample_rateObject

Returns the value of attribute sample_rate.



7
8
9
# File 'lib/sound/format.rb', line 7

def sample_rate
  @sample_rate
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/sound/format.rb', line 7

def type
  @type
end