URL Audio Resource Streaming Stopped Working

idk whats going on so maybe one of you can help... my bot has been broken for a few months I thought it was broken because of the URL changes but no URL seems to work only local files it says it started playing and immediately stops I don't hear anything though
--------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.16.1
- prism-media: 1.3.5

Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: not found

Encryption Libraries
- sodium-native: not found
- sodium: 3.0.2
- libsodium-wrappers: not found
- tweetnacl: not found

FFmpeg
- version: 6.0-static https://johnvansickle.com/ffmpeg/
- libopus: yes
--------------------------------------------------
--------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.16.1
- prism-media: 1.3.5

Opus Libraries
- @discordjs/opus: 0.9.0
- opusscript: not found

Encryption Libraries
- sodium-native: not found
- sodium: 3.0.2
- libsodium-wrappers: not found
- tweetnacl: not found

FFmpeg
- version: 6.0-static https://johnvansickle.com/ffmpeg/
- libopus: yes
--------------------------------------------------
Command received!
play
play
Now Playing: ROY_KNOX_-_Memory_Box_NCS_Release.mp3 by Matheson
Finished playing ROY_KNOX_-_Memory_Box_NCS_Release.mp3
Collected 0 items
Command received!
play
play
Now Playing: ROY_KNOX_-_Memory_Box_NCS_Release.mp3 by Matheson
Finished playing ROY_KNOX_-_Memory_Box_NCS_Release.mp3
Collected 0 items
[email protected] /workspaces/Coda-Music
[email protected] /workspaces/Coda-Music
node -v
v20.11.0
node -v
v20.11.0
14 Replies
d.js toolkit
d.js toolkit10mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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!
Matheson
MathesonOP10mo ago
it seems like the bot gives up immediately when the audio player enters the buffer state My work run for now is to use axios to download the file before playback to a temp dir and then it plays perfectly fine every single time
ThePedroo
ThePedroo10mo ago
The code, please
Matheson
MathesonOP10mo ago
I have the code with the workarround but I can write a simplified new bot demonstrating the issue it just seems to happen with the URL as a resource... something that used to work
ThePedroo
ThePedroo10mo ago
I had an issue that for some reason streams would abort randomly on URL & FFmpeg give errors So my fix was to create a PassThrough stream Manually write & end & handle errors And pass that stream to djs In the case of https only, making a https.get and passing the req/res worked
Matheson
MathesonOP10mo ago
I used to be able to pass the URL directly to create audio resource before version 16
ThePedroo
ThePedroo10mo ago
Ehh, passing streams is more reliable
✨𝓜𝓪𝓲𝓽𝓻𝓮𝓖𝓔𝓔𝓚ツ✨
Working for me thanks :maitre38Poutiblagueur:
ThePedroo
ThePedroo9mo ago
:blobguns:
ThePedroo
ThePedroo9mo ago
I am unsure why this happens, may be something to their internal code
✨𝓜𝓪𝓲𝓽𝓻𝓮𝓖𝓔𝓔𝓚ツ✨
Yeah that's what I thought because that's happening only on linux, on windows that works perfectly fine
ThePedroo
ThePedroo9mo ago
True? Weird (I don't use Windows, so never saw it working) Well, this is a good workaround at least
Want results from more Discord servers?
Add your server