RangeError: offset is out of bounds
Hello, I have an error when my bot play a song in a voice channel.
RangeError: offset is out of bounds
at Uint8Array.set ()
at OpusScript.decode (/home/LeGeek01/SecretHeberg-Musique/node_modules/opusscript/index.js:78:17)
at Decoder._decode (/home/LeGeek01/SecretHeberg-Musique/node_modules/prism-media/src/opus/Opus.js:64:25)
at Decoder._transform (/home/LeGeek01/SecretHeberg-Musique/node_modules/prism-media/src/opus/Opus.js:204:22)
at Decoder.Transform._write (node:internal/streams/transform:184:23)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
at Decoder.Writable.write (node:internal/streams/writable:334:10)
at PassThrough.ondata (node:internal/streams/readable:749:22)
at PassThrough.emit (node:events:394:28)
I have :
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Thanks in advance for answers.
Same Problem
I fix that by deleting the "type" or "mode" option, I don't remember because it was a year ago... I know this variable was equal to "opus"
Can u provide the code ?
The code that fix this issue
any fix on this yet
Modify MAX_FRAME_SIZE = 48000 * 60 / 1000 to MAX_FRAME_SIZE = 960 * 6 in index.js, supports up to 120ms per frame
https://github.com/abalabahaha/opusscript/blob/07ae74db7385d6d1be981d929f2f2f2b7e6b8449/index.js#L21-L25
https://github.com/abalabahaha/opusscript/blob/07ae74db7385d6d1be981d929f2f2f2b7e6b8449/src/opusscript_encoder.cpp#L5-L9