v5.0.0 Ogg Support (and other sundry items)
Ogg support had been sitting around ready to go for a while, might as well release it since matroska/webm support is going to be a while longer...
New Features/Fixes
- Support for Ogg files (Vorbis, Theora, Opus)
- Large rewrite of
ByteVectorclass to reduce needless copying of bytes.ByteVectors are now copy-on-write and use node's buffer views to implement subarray processing without a copying the entire contents. This greatly improves performance!fromBase64StringandtoBase64Stringhave been added- see breaking changes notes below for stuff that's been broken
Breaking Changes
- The interface for working with
ByteVectors has changed significantlyfromByteVectorhas been removed, usetoByteVectoron an existing object to make the copy-on-write copyByteVectorconstruction methods no longer takeisReadOnlyas an argument, instead usemakeReadOnly()on the new object to make it read only.fromStringno longer has a defaulttype, default behavior was to useStringType.UTF8fromU*andtoU*methods were renamed to be consistently named - eg,fromUShortis nowfromUshortlastUtf16Encodingproperty has moved into theEncodingclass which now handles all encoding and decoding- Direct access to the backing Uint8Array via
datahas been removed. The alternative is to usetoByteArray(). Try to avoid using this as much as you can since it has the potential to break copy-on-write. It only exists for the the handful of instances where it is more performant to directly use the buffer for IO operations. get hashCodehas been removed, callget checksuminsteadget isViewis added (mostly as a diagnostic/debugging tool) to indicate if theByteVectoris backed by a buffer view over another buffer or if it is backed by the buffer.- Check for read-only now happens after checking the arguments for their proper type
containsAtno longer accepts apatternOffsetor apatternLength. If a subset of the pattern needs to be checked, usesubon the pattern. It's super cheap now!findno longer takes an offset. Iffindneeds to start at an offset in theByteVector, use the shortcutoffsetFindinsertByte,insertByteArray, andinsertByteVectorhave all been removed. (it behaves the same as splice for JS arrays)midis renamed tosubarray(to better match JS array method names)removeAtIndexandremoveRangehave been removed, usespliceinstead (it behaves the same as splice for JS arrays)resizeno longer returns the object, it is a pure function.rFindno longer accepts an offset, userFindon the result ofsubarrayif offset is neededtoFloatnow handlesByteVectorsof size <4 gracefully instead of throwing an errortoStringsno longer accepts anoffsetparameter, usesubarrayto get an offsetByteVector, then calltoStrings
- Lots of static readonly members have been renamed to SCREAMING_SNAKE_CASE. If you're using one and it shows up as not defined, try using the SCREAMING_SNAKE_CASE version. (eg,
AacAudioHeader.unknown=>AacAudioHeader.UNKNOWN)