Class: Sound::Format
- Inherits:
-
Object
- Object
- Sound::Format
- Includes:
- FormatLibrary
- Defined in:
- lib/sound/format.rb
Constant Summary
Constants included from FormatLibrary
Sound::FormatLibrary::DEFAULT_FORMAT
Instance Attribute Summary collapse
-
#bits_per_sample ⇒ Object
(also: #bps)
Returns the value of attribute bits_per_sample.
-
#channels ⇒ Object
Returns the value of attribute channels.
-
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type = FormatLibrary::DEFAULT_FORMAT) ⇒ Format
constructor
A new instance of Format.
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_sample ⇒ Object 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 |
#channels ⇒ Object
Returns the value of attribute channels.
7 8 9 |
# File 'lib/sound/format.rb', line 7 def channels @channels end |
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
7 8 9 |
# File 'lib/sound/format.rb', line 7 def sample_rate @sample_rate end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/sound/format.rb', line 7 def type @type end |