AbstractProtected_Whether multi-byte integers in this container are big-endian (true for AIFF/FORM, false for WAV/RIFF).
Protected_The underlying I/O stream.
Protected_Whether the file was parsed successfully. Subclasses set this to false
when a fatal parse error is encountered.
Total number of top-level chunks found in the file.
The chunk count.
Whether the underlying stream is currently open. Synchronous.
Whether this file was parsed successfully.
The name (path) of the underlying stream, as reported by the stream itself. Synchronous.
Whether the underlying stream is read-only. Synchronous.
The format identifier from the file header (e.g. "WAVE", "AIFF", "AIFC").
AbstractaudioReturns the format-specific audio properties, or null if unavailable.
The audio properties object, or null.
Reads and returns the raw data bytes of the chunk at the given index.
Zero-based chunk index.
A promise resolving to the chunk's data as a ByteVector.
Returns the data size (in bytes) of the chunk at the given index.
Zero-based chunk index.
Chunk data size in bytes.
Returns the four-character identifier of the chunk at the given index.
Zero-based chunk index.
The chunk name (e.g. "fmt ", "data").
Returns the byte offset of the chunk data (past the 8-byte header) at the given index.
Zero-based chunk index.
Byte offset within the file.
Returns the number of pad bytes (0 or 1) appended to the chunk at the given index.
Zero-based chunk index.
Padding byte count.
Resets the stream position to the beginning (equivalent to
seek(0, Position.Beginning)).
A promise that resolves when the operation is complete.
Returns all complex property values for the given key.
The complex property key.
An array of VariantMap objects.
Returns the list of complex-property keys supported by the tag.
An array of key strings (e.g. "PICTURE").
Returns the total length of the stream in bytes.
Note: this is an async method rather than a getter because getters cannot
be async.
A promise resolving to the stream length in bytes.
Searches the stream forward for pattern starting at fromOffset.
The stream cursor is restored to its original position after the search.
If before is provided, the search stops (returning -1) as soon as
before is encountered.
The byte sequence to search for.
Byte offset at which to start searching. Defaults to 0.
Optionalbefore: ByteVectorOptional sentinel; if found before pattern, returns -1.
A promise resolving to the byte offset of the first match, or
-1 if not found.
Inserts data into the stream at start, optionally replacing replace
bytes.
The bytes to insert.
Byte offset at which to insert. Defaults to 0.
Number of bytes to overwrite. Defaults to 0.
A promise that resolves when the operation is complete.
ProtectedparseReads the RIFF/FORM file header and populates the internal chunk list.
Sets _valid to false if the file header is missing or unrecognised.
Returns a PropertyMap containing all tag fields exposed by this file's tag. Returns an empty map if no tag is present.
The property map.
Reads up to length bytes from the current stream position.
The maximum number of bytes to read.
A promise resolving to the bytes read as a ByteVector.
Remove ALL chunks matching name from both the file and the in-memory chunk list.
Matches C++ RIFF::File::removeChunk(const ByteVector &name) which removes all occurrences.
Four-character chunk identifier to remove.
Removes length bytes from the stream starting at start.
Byte offset of the first byte to remove. Defaults to 0.
Number of bytes to remove. Defaults to 0.
A promise that resolves when the operation is complete.
Remove the first chunk matching name from both the file and the in-memory chunk list.
Four-character chunk identifier to remove.
Removes unsupported properties from the tag.
The list of property keys to remove.
Searches the stream backward for pattern, starting at fromOffset
(default: end of file).
The stream cursor is restored to its original position after the search.
If before is provided, the search stops (returning -1) as soon as
before is encountered while scanning backward.
The byte sequence to search for.
Upper bound for the search. 0 means end of file.
Defaults to 0.
Optionalbefore: ByteVectorOptional sentinel; if found before pattern, returns -1.
A promise resolving to the byte offset of the match, or -1 if
not found.
AbstractsaveWrites all pending tag and metadata changes back to the stream.
A promise that resolves to true on success, false on failure.
Moves the stream's read/write cursor to offset relative to position.
The byte offset to seek to.
The seek origin. Defaults to Position.Beginning.
A promise that resolves when the seek is complete.
Set (or add) a chunk with the given four-character name.
If overwrite is true (default) and a chunk with the same name already
exists, its data is replaced in-place; otherwise a new chunk is appended.
Four-character chunk identifier.
Raw data bytes to store in the chunk.
When true, replace an existing chunk with the same name.
Sets complex property values for the given key.
The complex property key.
The array of VariantMap objects to store.
true if the property was set, false if not supported.
Replaces the tag's properties with the supplied map and returns a map of properties that could not be set (unsupported keys).
The new property map to apply.
A map of properties that were not applied.
AbstracttagReturns the current byte offset of the stream cursor.
A promise resolving to the cursor position.
Truncates (or extends) the stream to exactly length bytes.
The desired stream length in bytes.
A promise that resolves when the truncation is complete.
Writes data at the current stream position.
The bytes to write.
A promise that resolves when the write is complete.
Staticbuffer
Abstract base for RIFF container formats (WAV uses little-endian "RIFF", AIFF uses big-endian "FORM").
File layout: fileId(4) + fileSize(4) + format(4) + chunks… Each chunk: chunkId(4) + chunkSize(4) + data (padded to even byte boundary)