Class: Id3v2FrameHeader
March 10, 2023 · View on GitHub
node-taglib-sharp / Exports / Id3v2FrameHeader
Class: Id3v2FrameHeader
This class provides a representation of an ID3v2 frame header which can be read from and written to disk.
Table of contents
Constructors
Accessors
Methods
Constructors
constructor
• new Id3v2FrameHeader(id, flags?, frameSize?)
Constructs and initializes a new instance by processing the data for the frame header.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
id | Id3v2FrameIdentifier | undefined | Identifier of the frame |
flags | Id3v2FrameFlags | Id3v2FrameFlags.None | Flags to assign to the frame (if omitted, defaults to None) |
frameSize | number | 0 | Size of the frame in bytes, excluding the size of the header (if omitted, defaults to 0) |
Accessors
flags
• get flags(): Id3v2FrameFlags
Gets the flags applied to the current instance.
Returns
• set flags(value): void
Sets the flags applied to the current instance.
Parameters
| Name | Type |
|---|---|
value | Id3v2FrameFlags |
Returns
void
frameId
• get frameId(): Id3v2FrameIdentifier
Gets the identifier of the frame described by the current instance.
Returns
• set frameId(value): void
Sets the identifier of the frame described by the current instance.
Parameters
| Name | Type |
|---|---|
value | Id3v2FrameIdentifier |
Returns
void
frameSize
• get frameSize(): number
Gets the size of the frame described by the current instance, minus the header.
Returns
number
• set frameSize(value): void
Sets the size of the frame described by the current instance, minus the header. Must be a positive, safe integer.
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Methods
render
▸ render(version): ByteVector
Renders the current instance, encoded in a specified ID3v2 version.
Parameters
| Name | Type | Description |
|---|---|---|
version | number | Version of ID3v2 to use when encoding the current instance. |
Returns
fromData
▸ Static fromData(data, version): Id3v2FrameHeader
Constructs and initializes a new instance of Id3v2FrameHeader by reading it from raw header data of a specified version.
Parameters
| Name | Type | Description |
|---|---|---|
data | ByteVector | Raw data to build the new instance from. If the data size is smaller than the size of a full header, the data is just treated as a frame identifier and the remaining values are zeroed. |
version | number | ID3v2 version with which the data in data was encoded. |
Returns
fromFrameIdentifier
▸ Static fromFrameIdentifier(id): Id3v2FrameHeader
Constructs and initializes a new, blank frame header of size 0, with the provided frame identifier.
Parameters
| Name | Type | Description |
|---|---|---|
id | Id3v2FrameIdentifier | Identifier for the frame |
Returns
getSize
▸ Static getSize(version): number
Gets the size of a header for a specified ID3v2 version.
Parameters
| Name | Type | Description |
|---|---|---|
version | number | Version of ID3v2 to get the size for. Must be a positive integer < 256 |
Returns
number