anthumchris / opus-stream-decoder

Instantly decode Ogg Opus audio streams in chunks with JavaScript & WebAssembly (Wasm)
124 stars 21 forks source link

Read granule position as signed 64-bit Int #4

Closed anthumchris closed 5 years ago

anthumchris commented 5 years ago

As noted by @chris-rudmin, granule position is a signed int and should be read with a getInt64() polyfill, not the unsigned value provided by getUint64() in https://github.com/AnthumChris/opus-stream-decoder/commit/315293dbe2c6f4a90feeb0e1d48ea816cc9e46e9#diff-198c709b4ac56e17c7968212a63591daR259

anthumchris commented 5 years ago

Granule position will either be -1 or a positive int, so getInt64 should suffice for the purposes of reading granules.