Class: WaveFile::ChunkReaders::RiffReader::DataChunkReader
- Inherits:
-
BaseChunkReader
- Object
- BaseChunkReader
- WaveFile::ChunkReaders::RiffReader::DataChunkReader
- Defined in:
- lib/wavefile/chunk_readers/header_reader.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#sample_frame_count ⇒ Object
readonly
Returns the value of attribute sample_frame_count.
Instance Method Summary collapse
-
#initialize(file, native_format) ⇒ DataChunkReader
constructor
A new instance of DataChunkReader.
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_count ⇒ Object (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 |