Skip to content

v5.0.0 Ogg Support (and other sundry items)

Compare
Choose a tag to compare
@benrr101 benrr101 released this 09 Jul 19:49
· 46 commits to master since this release

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. 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!
    • fromBase64String and toBase64String have been added
    • see breaking changes notes below for stuff that's been broken

Breaking Changes

  • The interface for working with ByteVectors has changed significantly
    • fromByteVector has been removed, use toByteVector on an existing object to make the copy-on-write copy
    • ByteVector construction methods no longer take isReadOnly as an argument, instead use makeReadOnly() on the new object to make it read only.
    • fromString no longer has a default type, default behavior was to use StringType.UTF8
    • fromU* and toU* methods were renamed to be consistently named - eg, fromUShort is now fromUshort
    • lastUtf16Encoding property has moved into the Encoding class which now handles all encoding and decoding
    • Direct access to the backing Uint8Array via data has been removed. The alternative is to use toByteArray(). 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, call get checksum instead
    • get isView is added (mostly as a diagnostic/debugging tool) to indicate if the ByteVector 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 a patternOffset or a patternLength. If a subset of the pattern needs to be checked, use sub on the pattern. It's super cheap now!
    • find no longer takes an offset. If find needs to start at an offset in the ByteVector, use the shortcut offsetFind
    • insertByte, insertByteArray, and insertByteVector have all been removed. (it behaves the same as splice for JS arrays)
    • mid is renamed to subarray (to better match JS array method names)
    • removeAtIndex and removeRange have been removed, use splice 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, use rFind on the result of subarray if offset is needed
    • toFloat now handles ByteVectors of size <4 gracefully instead of throwing an error
    • toStrings no longer accepts an offset parameter, use subarray to get an offset ByteVector, then call toStrings
  • 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)