If an error was thrown from the last operation such as read
or save
, this returns the error message. It is recommended
to check this property every operation.
Reads the tags from the buffer. If the decoding was successful, this sets the
tags
with the decoded tags otherwise this sets the
error
property with error. This always returns the tags
.
// Default Options
{
id3v1: true, // include ID3v1
id3v2: true, // include ID3v2
unsupported: false // if true, parses unsupported frames as an array of bytes. Otherwise, skip
}
This function is the same as the read
except that this is a
static function. If the decoding was unsuccessful, this throws an error.
Writes the tags
to the buffer. If the encoding was successful,
this writes the tags to the buffer then returns it otherwise this sets the
error
property with error. This always returns the buffer
.
// Default Options
{
strict: false, // Use strict mode when validating
/**
* Encoding to use when writing ID3v1 tags. Valid options are:
* 'utf-8', 'utf8', 'utf16', 'utf-16', 'utf16be', 'utf-16be', 'windows1251', ''
*/
encoding: 'utf-8',
id3v1: {
include: false, // Add ID3v1 tags to buffer
encoding: 'utf-8'
},
id3v2: {
include: true, // Add ID3v2 tags to buffer
unsynch: false, // Use unsynchronisation scheme
version: defaultVersion, // ID3v2 major version
padding: 2048, // Number of null bytes added after ID3v2 tag
unsupported: false, // Whether to write unsupported frames to buffer. Otherwise, skips
encoding: 'utf-8'
}
}
This function is the same as the save
except that this is a
static function. If the encoding was unsuccessful, this throws an error.
Removes all the tags from the buffer. This always return true.
This function is the same as the getAudio
except that this is
a static function.