Class: WaveFile::ChunkReaders::RiffReader

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

Overview

Internal: Used to read the RIFF chunks in a wave file up until the data chunk. Thus it can be used to open a wave file and “queue it up” to the start of the actual sample data, as well as extract information out of pre-data chunks, such as the format chunk.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io, format = nil) ⇒ RiffReader

:nodoc:



7
8
9
10
11
# File 'lib/wavefile/chunk_readers/riff_reader.rb', line 7

def initialize(io, format=nil)
  @io = io

  read_until_data_chunk(format)
end

Instance Attribute Details

#data_chunk_readerObject (readonly)

Returns the value of attribute data_chunk_reader.



13
14
15
# File 'lib/wavefile/chunk_readers/riff_reader.rb', line 13

def data_chunk_reader
  @data_chunk_reader
end

#native_formatObject (readonly)

Returns the value of attribute native_format.



13
14
15
# File 'lib/wavefile/chunk_readers/riff_reader.rb', line 13

def native_format
  @native_format
end

#sample_chunkObject (readonly)

Returns the value of attribute sample_chunk.



13
14
15
# File 'lib/wavefile/chunk_readers/riff_reader.rb', line 13

def sample_chunk
  @sample_chunk
end