Class: Raiff::Chunk::Common
- Inherits:
-
Raiff::Chunk
- Object
- Raiff::Chunk
- Raiff::Chunk::Common
- Defined in:
- lib/raiff/chunk/common.rb
Instance Attribute Summary collapse
-
#bytes_per_sample ⇒ Object
readonly
Returns the value of attribute bytes_per_sample.
-
#channels ⇒ Object
readonly
Properties ===========================================================.
-
#sample_frames ⇒ Object
readonly
Properties ===========================================================.
-
#sample_rate ⇒ Object
readonly
Properties ===========================================================.
-
#sample_size ⇒ Object
readonly
Properties ===========================================================.
Attributes inherited from Raiff::Chunk
Instance Method Summary collapse
-
#initialize(file) ⇒ Common
constructor
Instance Methods =====================================================.
- #inspect ⇒ Object
Constructor Details
#initialize(file) ⇒ Common
Instance Methods =====================================================
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/raiff/chunk/common.rb', line 11 def initialize(file) super(file) chunk_end = file.offset + @size @channels, @sample_frames, @sample_size = file.unpack('nNn') @sample_rate = file.unpack_extended_float @bytes_per_sample = (@sample_size - 1) / 8 + 1 end |
Instance Attribute Details
#bytes_per_sample ⇒ Object (readonly)
Returns the value of attribute bytes_per_sample.
5 6 7 |
# File 'lib/raiff/chunk/common.rb', line 5 def bytes_per_sample @bytes_per_sample end |
#channels ⇒ Object (readonly)
Properties ===========================================================
4 5 6 |
# File 'lib/raiff/chunk/common.rb', line 4 def channels @channels end |
#sample_frames ⇒ Object (readonly)
Properties ===========================================================
4 5 6 |
# File 'lib/raiff/chunk/common.rb', line 4 def sample_frames @sample_frames end |
#sample_rate ⇒ Object (readonly)
Properties ===========================================================
4 5 6 |
# File 'lib/raiff/chunk/common.rb', line 4 def sample_rate @sample_rate end |
#sample_size ⇒ Object (readonly)
Properties ===========================================================
4 5 6 |
# File 'lib/raiff/chunk/common.rb', line 4 def sample_size @sample_size end |
Instance Method Details
#inspect ⇒ Object
23 24 25 |
# File 'lib/raiff/chunk/common.rb', line 23 def inspect "<#{self.class}\##{object_id} #{@id} #{@size} channels=#{channels} sample_frames=#{sample_frames} sample_size=#{sample_size} sample_rate=#{'%.2f' % sample_rate}>" end |