v6.0.0 MP3 VBR Header Improvements, Msc Bug Fixes
In what appears to be a disappointing trend, I'm once again super slow at releasing this new version.. But here it is, and I can say it's a big improvement. There are some technically breaking changes in this release, hence the major version bump. Let's go through changes:
New Features / Fixes
- MP3 Audio Header Improvements
- This code has basically been rewritten to rework how MPEG audio headers are read, especially fixing how VBR headers are treated.
- Xing VBR headers now properly consider
Info
headers that indicate a a file is CBR - Xing VBR headers now read into the optional LAME header extension to get encoder delays to give even more accurate duration calculations
- Calculation of duration and bitrate is now calculated with fallbacks such that we really will give it a best shot to calculate these values before giving up and returning 0.
- Headers with reserved bitrates or sample rates are ignored
- MPEG4 Fix - There was a bug when writing MPEG4 tags that often resulted in corruption of the tags. This has been fixed!
- APE Tag Fixes
- Integration test for APE file reading was fixed (test file was being duplicated and read as MP3, which was silently passing prior to fixing MP3 headers)
- When reading attached pictures, more bytes than expected could be read if the picture was not the last item in the tag. This has been fixed.
- Combined tag ReplayGain, IsCompilation behavior
- Combined tags are designed to check all tags within for a value to return. Falsy values and "default" values would be skipped.
- For ReplayGain, NaN is the default value. However, NaN cannot be checked for equality with
===
, so it was being treated by CombinedTag as a "truey" value. This has been fixed, so numeric values are the only ones returned. - For IsCompilation, undefined was being used as the default value. This has been changed to be false.
- In the next release, I will be exploring returning undefined for all unset tag values. This should make it clearer which tags are set and which are not set.
- Updated dependencies that had vulnerabilities (really only affects dev)
Breaking Changes
MpegAudioHeader
xingHeader
andvbriHeader
properties are removed and replaced with a singlevbrHeader
property of typeVbrHeader
.- If no VBR header was found,
VbrHeader
will beundefined
VbrHeader
abstract class added with concrete instancesVbriHeader
andXingHeader
.bitrate
andduration
properties were added and return a truthy value if the values can be calculated with the header (basically only applies to Xing headers in which total frames and total bytes is optional)Unknown
static instances have been removed. If a header doesn't exist, thevbrHeader
property will beundefined
Special Thanks:
- Special thanks for @ion-dev for fixing the big bug in MPEG4 tag writing! I'd still be looking into it if you hadn't fixed it
📦 NPM Link: https://www.npmjs.com/package/node-taglib-sharp/v/6.0.0