node-taglib-sharp / Exports / Id3v2RelativeVolumeFrame
Extends Frame, implementing support for ID3v2 relative volume (RVA2) frames.
-
↳
Id3v2RelativeVolumeFrame
- clone
- fieldData
- getPeakBits
- getPeakVolume
- getVolumeAdjustment
- parseFields
- render
- renderFields
- setData
- setPeakBits
- setPeakVolume
- setVolumeAdjustment
- toString
- correctEncoding
- find
- fromIdentification
- fromOffsetRawData
- fromRawData
• get channels(): Id3v2RelativeVolumeFrameChannelData[]
Gets the channels in the current instance that have a value
Id3v2RelativeVolumeFrameChannelData[]
• 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 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 identification(): string
Gets the identification used for the current instance
string
• 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
▸ 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 |
▸ getPeakBits(type): number
Gets the number of bits used to encode the peak volume
| Name | Type | Description |
|---|---|---|
type |
Id3v2RelativeVolumeFrameChannelType |
Which channel to get the value for |
number
▸ getPeakVolume(type): bigint
Gets the peak volume for a specified channel
| Name | Type | Description |
|---|---|---|
type |
Id3v2RelativeVolumeFrameChannelType |
Which channel to get the value for |
bigint
▸ getVolumeAdjustment(type): number
Gets the volume adjustment for the specified channel.
| Name | Type | Description |
|---|---|---|
type |
Id3v2RelativeVolumeFrameChannelType |
Which channel to get the value for |
number
Volume adjustment for the channel, can be betweenInclusive -64 and +64 decibels
▸ 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(): ByteVector
Renders the values in the current instance into field data for a specified version.
▸ 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
▸ setPeakBits(type, value): void
Sets the number of bits used to encode peak volume for a specified channel.
| Name | Type | Description |
|---|---|---|
type |
Id3v2RelativeVolumeFrameChannelType |
Which channel to set the value for |
value |
number |
Peak volume |
void
▸ setPeakVolume(type, value): void
Sets the peak volume for a specified channel.
| Name | Type | Description |
|---|---|---|
type |
Id3v2RelativeVolumeFrameChannelType |
Which channel to set the value for |
value |
bigint |
Peak volume |
void
▸ setVolumeAdjustment(type, value): void
Sets the volume adjustment in decibels for the specified channel.
| Name | Type | Description |
|---|---|---|
type |
Id3v2RelativeVolumeFrameChannelType |
Which channel to set the value for |
value |
number |
Volume adjustment in decibels. Must be betweenInclusive -64 and +64 |
void
▸ toString(): string
Creates a text description of the current instance
string
▸ 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, identification): Id3v2RelativeVolumeFrame
Gets a specified volume adjustment frame from the list of relative volume frames
| Name | Type | Description |
|---|---|---|
frames |
Id3v2RelativeVolumeFrame[] |
List of frames to search |
identification |
string |
Identification to match |
Frame containing the matching user or undefined if a match was not found
▸ Static fromIdentification(identification): Id3v2RelativeVolumeFrame
Constructs and initializes a new instance with a specified identifier
| Name | Type | Description |
|---|---|---|
identification |
string |
Identification ot use for the new frame |
▸ Static fromOffsetRawData(data, offset, header, version): Id3v2RelativeVolumeFrame
Constructs and initializes a new instance by reading its raw data in a specified ID3v2 version starting a specified offset.
| Name | Type | Description |
|---|---|---|
data |
ByteVector |
Raw representation of the new frame |
offset |
number |
Offset into data where the frame actually begins. Must be a positive, 32-bit 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): Id3v2RelativeVolumeFrame
Constructs and initializes a new instance by reading its raw data in a specified ID3v2 version.
| Name | Type | Description |
|---|---|---|
data |
ByteVector |
Raw representation of the new frame |
version |
number |
ID3v2 version the frame is encoded with. Must be a positive 8-bit integer. |