node-taglib-sharp / Exports / Id3v2Synchronized
This class extends Frame and implements support for ID3v2 Synchronized Lyrics and Text (SYLT) frames.
-
↳
Id3v2Synchronized
- description
- encryptionId
- flags
- format
- frameClassType
- frameId
- groupId
- header
- language
- size
- text
- textEncoding
- textType
- clone
- fieldData
- parseFields
- render
- renderFields
- setData
- correctEncoding
- find
- findPreferred
- fromInfo
- fromOffsetRawData
- fromRawData
• get description(): string
Gets the description of the current instance.
string
• set description(value): void
Sets the description of the current instance. There should only be one frame with a matching description, type, and ISO-639-2 language code per tag.
| Name | Type | Description |
|---|---|---|
value |
string |
Description to store |
void
• get encryptionId(): number
Gets the encryption ID applied to the current instance.
number
Value containing the encryption identifier for the current instance or
undefined if not set.
Frame.encryptionId
• set encryptionId(value): void
Sets the encryption ID applied to the current instance.
| Name | Type | Description |
|---|---|---|
value |
number |
Value containing the encryption identifier for the current instance. Must be an 8-bit unsigned integer. Setting to undefined will remove the encryption header and ID |
void
Frame.encryptionId
• get flags(): Id3v2FrameFlags
Gets the frame flags applied to the current instance.
Frame.flags
• set flags(value): void
Sets the frame flags applied to the current instance. If the value includes either Encryption or Compression, render will throw.
| Name | Type |
|---|---|
value |
Id3v2FrameFlags |
void
Frame.flags
• get format(): Id3v2TimestampFormat
Gets the timestamp format used by the current instance.
• set format(value): void
Sets the timestamp format used by the current instance.
| Name | Type | Description |
|---|---|---|
value |
Id3v2TimestampFormat |
Timestamp format to use |
void
• get frameClassType(): Id3v2FrameClassType
Gets a flag indicating which type of frame the current instance is.
Frame.frameClassType
• get frameId(): Id3v2FrameIdentifier
Gets the frame ID for the current instance.
Object representing of the identifier of the frame
Frame.frameId
• get groupId(): number
Gets the grouping ID applied to the current instance.
number
Value containing the grouping identifier for the current instance, or
undefined if not set.
Frame.groupId
• set groupId(value): void
Sets the grouping ID applied to the current instance.
| Name | Type | Description |
|---|---|---|
value |
number |
Grouping identifier for the current instance. Must be an 8-bit unsigned integer. Setting to undefined will remove the grouping identity header and ID |
void
Frame.groupId
• Protected get header(): Id3v2FrameHeader
Gets the header for the frame. For new frames this should not exist.
Frame.header
• Protected set header(value): void
Sets the header for the frame.
| Name | Type | Description |
|---|---|---|
value |
Id3v2FrameHeader |
Header for the frame |
void
Frame.header
• get language(): string
Gets the ISO-639-2 language code stored in the current instance
string
• set language(value): void
Sets the ISO-639-2 language code stored in the current instance. There should only be one frame with a matching description, type, and ISO-639-2 language code per tag.
| Name | Type | Description |
|---|---|---|
value |
string |
ISO-639-2 language code stored in the current instance |
void
• get size(): number
Gets the size of the current instance as it was last stored on disk. NOTE: This value is not used outside of reading a frame from disk, so newly created frames should not have this value set.
number
Frame.size
• get text(): Id3v2SynchronizedLyricsFrame[]
Gets the text contained in the current instance
Id3v2SynchronizedLyricsFrame[]
• set text(value): void
Sets the text contained in the current instance
| Name | Type | Description |
|---|---|---|
value |
Id3v2SynchronizedLyricsFrame[] |
Text contained in the current instance |
void
• get textEncoding(): StringType
Gets the text encoding to use when storing the current instance
• set textEncoding(value): void
Sets the text encoding to use when storing the current instance.
This encoding is overridden when rendering if forceDefaultEncoding is
true or the render version does not support it.
| Name | Type | Description |
|---|---|---|
value |
StringType |
Text encoding to use when storing the current instance |
void
• get textType(): Id3v2SynchronizedTextType
Gets the type of text contained in the current instance
• set textType(value): void
Sets the type of text contained in the current instance.
| Name | Type | Description |
|---|---|---|
value |
Id3v2SynchronizedTextType |
Type of the synchronized text |
void
▸ clone(): Id3v2Frame
Creates a deep copy of the current instance. This method is implemented by rendering the current instance as an ID3v2.4 frame and using the frame factory to create a new frame. As such, this method should be overridden by child classes.
▸ Protected fieldData(frameData, offset, version, dataIncludesHeader): ByteVector
Extracts the field data from the raw portion of an ID3v2 frame. This method is necessary for extracting extra data prepended to the frame such the as grouping ID.
| Name | Type | Description |
|---|---|---|
frameData |
ByteVector |
Raw frame data |
offset |
number |
Index at which the data is contained |
version |
number |
Version of the ID3v2 tag the data was originally encoded with |
dataIncludesHeader |
boolean |
true if frameData includes the header, false otherwise |
▸ Protected parseFields(data): void
Populates the values in this frame by parsing its field data in a specified version.
| Name | Type | Description |
|---|---|---|
data |
ByteVector |
Extracted field data |
void
▸ render(version): ByteVector
Renders the current instance, encoded in a specified ID3v2 version.
| Name | Type | Description |
|---|---|---|
version |
number |
Version of ID3v2 to use when encoding the current instance |
▸ Protected renderFields(version): ByteVector
Renders the values in the current instance into field data for a specified version.
| Name | Type | Description |
|---|---|---|
version |
number |
ID3v2 version the field data is to be encoded in. |
▸ Protected setData(data, offset, readHeader, version): void
Populates the current instance by reading the raw frame from disk, optionally reading the header.
| Name | Type | Description |
|---|---|---|
data |
ByteVector |
Raw ID3v2 frame |
offset |
number |
Offset in data at which the frame begins. |
readHeader |
boolean |
Whether or not to read the reader into the current instance. |
version |
number |
Version of the ID3v2 tag the data was encoded with |
void
▸ Static Protected correctEncoding(type, version): StringType
Converts an encoding to be a supported encoding for a specified tag version.
| Name | Type | Description |
|---|---|---|
type |
StringType |
Value containing the original encoding |
version |
number |
Value containing the ID3v2 version to be encoded. |
Value containing the correct encoding to use, based on
forceDefaultEncoding and what is supported by
version
▸ Static find(frames, description, textType, language?): Id3v2Synchronized
Gets a specified lyrics frame from a list of synchronized lyrics frames
| Name | Type | Description |
|---|---|---|
frames |
Id3v2Synchronized[] |
List of frames to search |
description |
string |
Description to match |
textType |
Id3v2SynchronizedTextType |
Text type to match |
language? |
string |
Optionally, ISO-639-2 language code to match |
Frame containing the matching user, undefined if a match was not found
▸ Static findPreferred(frames, description, language, textType): Id3v2Synchronized
Gets a synchronized lyrics frame from the specified list, trying to match the description and language but accepting an incomplete match. This method tries matching with the following order of precedence:
- The first frame with a matching description, language, and type.
- The first frame with a matching description and language.
- The first frame with a matching language.
- The first frame with a matching description.
- The first frame with a matching type.
- The first frame.
| Name | Type | Description |
|---|---|---|
frames |
Id3v2Synchronized[] |
List of frames to search for the best match |
description |
string |
Description to match |
language |
string |
ISO-639-2 language code to match |
textType |
Id3v2SynchronizedTextType |
Text type to match |
The matching frame or undefined if a match was not found
▸ Static fromInfo(description, language, textType, encoding?): Id3v2Synchronized
Constructs and initializes a new instance with a specified description, ISO-639-2 language code, text type, and text encoding.
| Name | Type | Default value | Description |
|---|---|---|---|
description |
string |
undefined |
Description of the synchronized lyrics frame |
language |
string |
undefined |
ISO-639-2 language code of the new instance |
textType |
Id3v2SynchronizedTextType |
undefined |
Type of the text to store in the new instance |
encoding |
StringType |
Id3v2Settings.defaultEncoding |
Encoding to use when rendering text in this new instance |
▸ Static fromOffsetRawData(data, offset, header, version): Id3v2Synchronized
Constructs and initializes a new instance by reading its raw data in a specified ID3v2 format.
| Name | Type | Description |
|---|---|---|
data |
ByteVector |
Raw representation of the new instance |
offset |
number |
Offset into data where the frame begins. Must be unsigned, safe integer |
header |
Id3v2FrameHeader |
Header of the frame found at offset in data |
version |
number |
ID3v2 version the frame was originally encoded with |
▸ Static fromRawData(data, version): Id3v2Synchronized
Constructs and initializes a new instance by reading its raw data in a specified ID3v2 format.
| Name | Type | Description |
|---|---|---|
data |
ByteVector |
Raw representation of the new instance |
version |
number |
ID3v2 version the raw frame is encoded with. Must be unsigned 8-bit integer. |