RIFFFile

riff-file. RIFFFile

A class to perform low-level reading of RIFF/RIFX files.

Constructor

new RIFFFile()

Source:

Members

chunkSize :number

Source:
The main chunk size, in bytes.
Type:
  • number

container :string

Source:
The container identifier. 'RIFF', 'RIFX' and 'RF64' are supported.
Type:
  • string

format :string

Source:
The format identifier.
Type:
  • string
Source:
Type:
  • number

signature :Object|null

Source:
An object representing the signature of all chunks in the file.
Type:
  • Object | null

(protected, non-null) supported_containers :Array.<string>

Source:
The list of supported containers. Any format different from RIFX will be treated as RIFF.
Type:
  • Array.<string>

(protected) uInt32 :Object

Source:
Type:
  • Object

Methods

(protected) findChunk(chunkId, multiple) → {Object}

Source:
Find a chunk by its fourCC_ in a array of RIFF chunks.
Parameters:
Name Type Default Description
chunkId string The chunk fourCC_.
multiple boolean false True if there may be multiple chunks with the same chunkId.
Returns:
Type
Object

(protected) readString(bytesnon-null, maxSize) → {string}

Source:
Read bytes as a string from a RIFF chunk.
Parameters:
Name Type Description
bytes Uint8Array The bytes.
maxSize number the max size of the string.
Returns:
The string.
Type
string

(protected) readUInt32(bytesnon-null) → {number}

Source:
Read a number from a chunk.
Parameters:
Name Type Description
bytes Uint8Array The chunk bytes.
Returns:
The number.
Type
number

(protected) setSignature(buffernon-null)

Source:
Read the signature of the chunks in a RIFF/RIFX file.
Parameters:
Name Type Description
buffer Uint8Array The file bytes.