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

NameTypeDefault valueDescription
idId3v2FrameIdentifierundefinedIdentifier of the frame
flagsId3v2FrameFlagsId3v2FrameFlags.NoneFlags to assign to the frame (if omitted, defaults to None)
frameSizenumber0Size 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

Id3v2FrameFlags

set flags(value): void

Sets the flags applied to the current instance.

Parameters

NameType
valueId3v2FrameFlags

Returns

void


frameId

get frameId(): Id3v2FrameIdentifier

Gets the identifier of the frame described by the current instance.

Returns

Id3v2FrameIdentifier

set frameId(value): void

Sets the identifier of the frame described by the current instance.

Parameters

NameType
valueId3v2FrameIdentifier

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

NameType
valuenumber

Returns

void

Methods

render

render(version): ByteVector

Renders the current instance, encoded in a specified ID3v2 version.

Parameters

NameTypeDescription
versionnumberVersion of ID3v2 to use when encoding the current instance.

Returns

ByteVector


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

NameTypeDescription
dataByteVectorRaw 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.
versionnumberID3v2 version with which the data in data was encoded.

Returns

Id3v2FrameHeader


fromFrameIdentifier

Static fromFrameIdentifier(id): Id3v2FrameHeader

Constructs and initializes a new, blank frame header of size 0, with the provided frame identifier.

Parameters

NameTypeDescription
idId3v2FrameIdentifierIdentifier for the frame

Returns

Id3v2FrameHeader


getSize

Static getSize(version): number

Gets the size of a header for a specified ID3v2 version.

Parameters

NameTypeDescription
versionnumberVersion of ID3v2 to get the size for. Must be a positive integer < 256

Returns

number