RangeError: offset is out of bounds [@discordjs/opus]

Gathering a RangeError when attempting to play a shoutcast live stream [AUDIO ONLY], the bot has been playing stations like a charm for the past 7 months with no issue and recently arised, not sure what happened and even checked via ffmpeg stats and attempted to see the connection but it looks the same, 48000hz. Looks like its for buffering although not sure what the functionality behind it does at all in order to attempt to manually fix it.
[ UNCAUGHT EXCEPTION ] → RangeError: offset is out of bounds
at Uint16Array.set (<anonymous>)
at OpusScript.encode (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\opusscript\index.js:67:16)
at Encoder._encode (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\prism-media\src\opus\Opus.js:60:25)
at Encoder._transform (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\prism-media\src\opus\Opus.js:157:24)
at Transform._write (node:internal/streams/transform:171:8)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Writable.write (node:internal/streams/writable:508:10)
at VolumeTransformer.ondata (node:internal/streams/readable:1007:22)
at VolumeTransformer.emit (node:events:507:28)
[ UNCAUGHT EXCEPTION ] → RangeError: offset is out of bounds
at Uint16Array.set (<anonymous>)
at OpusScript.encode (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\opusscript\index.js:67:16)
at Encoder._encode (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\prism-media\src\opus\Opus.js:60:25)
at Encoder._transform (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\prism-media\src\opus\Opus.js:157:24)
at Transform._write (node:internal/streams/transform:171:8)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Writable.write (node:internal/streams/writable:508:10)
at VolumeTransformer.ondata (node:internal/streams/readable:1007:22)
at VolumeTransformer.emit (node:events:507:28)
https://gist.github.com/iiTxicz/81f6c628b4e79c3db54f00388401a70b - code
Gist
iheart.cmd.js
GitHub Gist: instantly share code, notes, and snippets.
No description
17 Replies
d.js toolkit
d.js toolkit2mo ago
- What are your intents? GuildVoiceStates is required to receive voice data! - Show what dependencies you are using -- generateDependencyReport() is exported from @discordjs/voice. - Try looking at common examples: https://github.com/discordjs/voice-examples. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
WhiteGarfield
WhiteGarfield2mo ago
What dependencies you are using?
jackasu
jackasuOP2mo ago
No description
jackasu
jackasuOP2mo ago
mb for the late reply
WhiteGarfield
WhiteGarfield2mo ago
thats a odd version of ffmpeg. could you provide the github from this dependencie?
jackasu
jackasuOP2mo ago
lemme see if i can get that version i installed it a while back via windows installation
WhiteGarfield
WhiteGarfield2mo ago
ok.
jackasu
jackasuOP2mo ago
it still continued afterwards:
[ UNCAUGHT EXCEPTION ] → RangeError: offset is out of bounds
at Uint16Array.set (<anonymous>)
at OpusScript.encode (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\opusscript\index.js:67:16)
at Encoder._encode (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\prism-media\src\opus\Opus.js:60:25)
at Encoder._transform (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\prism-media\src\opus\Opus.js:157:24)
at Transform._write (node:internal/streams/transform:171:8)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Writable.write (node:internal/streams/writable:508:10)
at VolumeTransformer.ondata (node:internal/streams/readable:1007:22)
at VolumeTransformer.emit (node:events:507:28)
[ UNCAUGHT EXCEPTION ] → RangeError: offset is out of bounds
at Uint16Array.set (<anonymous>)
at OpusScript.encode (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\opusscript\index.js:67:16)
at Encoder._encode (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\prism-media\src\opus\Opus.js:60:25)
at Encoder._transform (C:\Users\Administrator.WIN-RQ8CU7CCRJU\Documents\iheartbot-14-new\iheartbot-14-new\node_modules\prism-media\src\opus\Opus.js:157:24)
at Transform._write (node:internal/streams/transform:171:8)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Writable.write (node:internal/streams/writable:508:10)
at VolumeTransformer.ondata (node:internal/streams/readable:1007:22)
at VolumeTransformer.emit (node:events:507:28)
jackasu
jackasuOP2mo ago
No description
Retro
Retro2mo ago
this isnt a ffmpeg issue btw. its an opus encoder issue seems like the encoder failed to write encode the stream properly. could you try to manually make an ffmpeg stream via fluent ffmpeg or prism media and enter the output into createAudioResource?
jackasu
jackasuOP2mo ago
ill attempt this and let you know this is an aac shoutcast stream js to let you know so not sure if this could be a reason
Retro
Retro2mo ago
yeah idk either. but the error is coming from opus encoder really strange tbh
jackasu
jackasuOP2mo ago
i saw that it was tryna buffer like i saw the opus code from where it was coming from and it looks like its attempting to buffer or gather a value of some sort
Retro
Retro2mo ago
yeah tbh this is unlike anything ive seen before
jackasu
jackasuOP2mo ago
what would be the best solution to fix this?

Did you find this page helpful?