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.
Returns true if the file contains a physical APEv2 tag.
Returns true if the file contains a physical ID3v1 tag.
Returns true if the file contains a physical ID3v2 tag (i.e., one was
found during parsing or has been written by a previous save call).
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.
Get the APE tag, optionally creating one if absent.
Optionalcreate: booleanReturns the audio properties for this file, or null if they were not read.
The MPEG audio properties, or null.
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.
Returns the byte offset of the first valid MPEG audio frame in the file. Scanning begins after the ID3v2 tag (if present).
The file offset of the first frame, or -1 if not found.
Get the ID3v1 tag, optionally creating one if absent.
Optionalcreate: booleanGet the ID3v2 tag, optionally creating one if absent.
Optionalcreate: booleanInserts 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.
Returns the byte offset of the last valid MPEG audio frame in the file. Scanning ends before any trailing APE or ID3v1 tag.
The file offset of the last frame, or -1 if not found.
Scans forward from position and returns the offset of the next valid MPEG frame.
The byte offset at which to start scanning.
The file offset of the next valid frame, or -1 if not found.
Scans backward from position and returns the offset of the previous valid MPEG frame.
The byte offset at which to start scanning (inclusive).
The file offset of the previous valid frame, or -1 if not found.
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.
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.
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.
Saves the specified tag types to the file, optionally stripping tags not included in the save mask.
Bit-flag indicating which tag types to save (default: MpegTagTypes.AllTags).
Whether to strip tag types not present in tags (default: StripTags.StripOthers).
Optionalversion: numbertrue on success, false if the file is read-only.
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.
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.
Removes the specified tag types from the file.
Bit-flag indicating which tag types to strip (default: MpegTagTypes.AllTags).
Returns the combined tag that delegates to all present tag types, in priority order (ID3v2 > APE > ID3v1).
The combined tag instance.
Returns 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.
StaticbufferStaticopenOpens an MPEG file from the given stream, parsing tags and optionally audio properties.
A fully initialised MpegFile instance.
MPEG (MP3) file format handler.
Supports ID3v1, ID3v2 and APE tags as well as MPEG / ADTS audio property reading.