Class: WaveFile::ChunkReaders::RiffReader::DataChunkReader

Inherits:
BaseChunkReader
  • Object
show all
Defined in:
lib/wavefile/chunk_readers/header_reader.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseChunkReader

#raise_error, #read_chunk_size

Constructor Details

#initialize(file, native_format) ⇒ DataChunkReader

Returns a new instance of DataChunkReader.



95
96
97
98
99
100
101
# File 'lib/wavefile/chunk_readers/header_reader.rb', line 95

def initialize(file, native_format)
  @file = file
  @native_format = native_format

  data_chunk_size = @file.sysread(4).unpack(UNSIGNED_INT_32).first
  @sample_frame_count = data_chunk_size / @native_format.block_align
end

Instance Attribute Details

#sample_frame_countObject (readonly)

Returns the value of attribute sample_frame_count.



103
104
105
# File 'lib/wavefile/chunk_readers/header_reader.rb', line 103

def sample_frame_count
  @sample_frame_count
end