node-taglib-sharp / Exports / Id3v2Settings
This class contains settings related to ID3v2 tag operations. Open files will need to be re-read in order for changes to take effect.
- defaultEncoding
- defaultVersion
- footerSize
- forceDefaultEncoding
- forceDefaultVersion
- headerSize
- strictFrameForVersion
- useNonStandardV2V3GenreSeparators
- useNonStandardV2V3NumericGenres
- useNumericGenres
• Static
get
defaultEncoding(): StringType
Gets the encoding to use when creating new frames.
• Static
set
defaultEncoding(value
): void
Sets the encoding to use when creating new frames.
Name | Type | Description |
---|---|---|
value |
StringType |
Encoding to use when creating new frames |
void
• Static
get
defaultVersion(): number
Gets the default version to use when creating new tags.
If forceDefaultEncoding is true
then all tags will be rendered with this version.
number
• Static
set
defaultVersion(value
): void
Sets the default version to use when creating new tags.
If forceDefaultEncoding is true
then all tags will be rendered with this version.
Name | Type | Description |
---|---|---|
value |
number |
ID3v2 version to use. Must be 2, 3, or 4. The default for this library is 3 |
void
• Static
get
footerSize(): number
Size of an ID3v2 footer in bytes
number
• Static
get
forceDefaultEncoding(): boolean
Gets whether to render all frames with the default encoding rather than their original encoding.
boolean
• Static
set
forceDefaultEncoding(value
): void
Sets whether to render all frames with the default encoding rather than their original encoding.
Name | Type | Description |
---|---|---|
value |
boolean |
If true frames will be rendered using defaultEncoding rather than their original encoding. |
void
• Static
get
forceDefaultVersion(): boolean
Gets whether to save all tags in the default version rather than their original version.
boolean
• Static
set
forceDefaultVersion(value
): void
Sets whether to save all tags in the default version rather than their original version.
Name | Type | Description |
---|---|---|
value |
boolean |
If true , tags will be saved in the version defined in defaultVersion rather than their original format, except tags with footers which will always be saved in version 4 |
void
• Static
get
headerSize(): number
Size of an ID3v2 header in bytes
number
• Static
get
strictFrameForVersion(): boolean
Gets whether attempting to write a frame that is unsupported in the desired version
will throw an error.
If true
writing a frame that is not supported in the desired version will throw an error
during the render process. If false
if a frame is not supported in the desired version it
will be omitted from rendering and no error will be thrown.
boolean
• Static
set
strictFrameForVersion(value
): void
Sets whether attempting to write a frame that is unsupported in the desired version
will throw an error.
If true
writing a frame that is not supported in the desired version will throw an error
during the render process. If false
if a frame is not supported in the desired version it
will be omitted from rendering and no error will be thrown.
Name | Type |
---|---|
value |
boolean |
void
• Static
get
useNonStandardV2V3GenreSeparators(): boolean
Gets whether to use non-standard genre separators on ID3v2.2 and ID3v2.4.
If true
, the TCO/TCON frame value will be separated by ;
and/or /
, empty values will
be thrown out. If false
, the TCO/TCON frame value will be returned as-is (after processing
standard, escaped numeric genres).
Remarks
The official ID3v2 standard makes no mention of separators for genres, one of the
inherent flaws fixed in ID3v2.4. However, various media players, as well as the original
implementation of TagLib#, support using ;
and /
to separate genres. In order to
maintain compatibility, this functionality is preserved, but can be disabled by setting
useNonStandardV2V3GenreSeparators to false
.
boolean
• Static
set
useNonStandardV2V3GenreSeparators(value
): void
Sets whether to use non-standard genre separators on ID3v2.2 and ID3v2.3.
If true
, the TCO/TCON frame value will be separated by ;
and/or /
, empty values will
be thrown out. If false
, the TCO/TCON frame value will be returned as-is (after processing
standard, escaped numeric genres).
Remarks
The official ID3v2 standard makes no mention of separators for genres, one of the
inherent flaws fixed in ID3v2.4. However, various media players, as well as the original
implementation of TagLib#, support using ;
and /
to separate genres. In order to
maintain compatibility, this functionality is preserved, but can be disabled by setting
useNonStandardV2V3GenreSeparators to false
.
Name | Type |
---|---|
value |
boolean |
void
• Static
get
useNonStandardV2V3NumericGenres(): boolean
Gets whether to use non-standard numeric genre parsing on ID3v2.2 and ID3v2.3. If
true
, a purely numeric TCO/TCON frame value will attempt to be parsed as a numeric genre.
If false
, the TCO/TCON frame value will be returned without parsing purely numeric genres.
Remarks
The official ID3v2.2/ID3v2.3 standard only supports numeric genres if they are
escaped inside parenthesis (eg, (12)
). However, the original implementation of TagLib#
allowed ID3v2.2 and ID3v2.3 tags to parse unescaped numeric genres. In order to maintain
compatibility, this functionality is preserved, but can be disabled by setting
useNonStandardV2V3NumericGenres to false
.
boolean
• Static
set
useNonStandardV2V3NumericGenres(value
): void
Sets whether to use non-standard numeric genre parsing on ID3v2.2 and ID3v2.3. If
true
, a purely numeric TCO/TCON frame value will attempt to be parsed as a numeric genre.
If false
, the TCO/TCON frame value will be returned without parsing purely numeric genres.
Remarks
The official ID3v2.2/ID3v2.3 standard only supports numeric genres if they are
escaped inside parenthesis (eg, (12)
). However, the original implementation of TagLib#
allowed ID3v2.2 and ID3v2.3 tags to parse unescaped numeric genres. In order to maintain
compatibility, this functionality is preserved, but can be disabled by setting
useNonStandardV2V3NumericGenres to false
.
Name | Type |
---|---|
value |
boolean |
void
• Static
get
useNumericGenres(): boolean
Gets whether to use ID3v1 style numeric genres when possible.
If true
, the library will try looking up the numeric genre code when storing the value.
for ID3v2.2 and ID3v2.3 "Rock" would be stored as "(17)" and for ID3v2.4, it would be
stored as "17".
boolean
• Static
set
useNumericGenres(value
): void
Sets whether to use ID3v1 style numeric genres when possible.
If true
, the library will try looking up the numeric genre code when storing the value.
for ID3v2.2 and ID3v2.3 "Rock" would be stored as "(17)" and for ID3v2.4, it would be
stored as "17".
Name | Type | Description |
---|---|---|
value |
boolean |
Whether or not to use genres with numeric values when possible |
void