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
ByteVector
class to reduce needless copying of bytes.ByteVector
s 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!fromBase64String
andtoBase64String
have been added- see breaking changes notes below for stuff that's been broken
Breaking Changes
- The interface for working with
ByteVector
s has changed significantlyfromByteVector
has been removed, usetoByteVector
on an existing object to make the copy-on-write copyByteVector
construction methods no longer takeisReadOnly
as an argument, instead usemakeReadOnly()
on the new object to make it read only.fromString
no longer has a defaulttype
, default behavior was to useStringType.UTF8
fromU*
andtoU*
methods were renamed to be consistently named - eg,fromUShort
is nowfromUshort
lastUtf16Encoding
property has moved into theEncoding
class which now handles all encoding and decoding- Direct access to the backing Uint8Array via
data
has 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 hashCode
has been removed, callget checksum
insteadget isView
is added (mostly as a diagnostic/debugging tool) to indicate if theByteVector
is 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
containsAt
no longer accepts apatternOffset
or apatternLength
. If a subset of the pattern needs to be checked, usesub
on the pattern. It's super cheap now!find
no longer takes an offset. Iffind
needs to start at an offset in theByteVector
, use the shortcutoffsetFind
insertByte
,insertByteArray
, andinsertByteVector
have all been removed. (it behaves the same as splice for JS arrays)mid
is renamed tosubarray
(to better match JS array method names)removeAtIndex
andremoveRange
have been removed, usesplice
instead (it behaves the same as splice for JS arrays)resize
no longer returns the object, it is a pure function.rFind
no longer accepts an offset, userFind
on the result ofsubarray
if offset is neededtoFloat
now handlesByteVectors
of size <4 gracefully instead of throwing an errortoStrings
no longer accepts anoffset
parameter, usesubarray
to 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
)