Won't play if source takes long to send more data
When trying to play a big stream, which the speed is 30kbps, I was getting an issue where djs voice would send a trackEnd even though the stream is 2h long, and I saw that in hosts with a better connection (my internet is 200mbps, can't be slow wifi) it would work properly
The workaround I found was to use a setTimeout to 500ms, but I wonder if adding an option to add a length to the createAudioResource which it will only stop sending data when it finishes that length, and till it doesn't, it will wait next data.
But I'd like to see how can I really fix this, since setTimeout isn't a good fix since will slowdown it whenever the source is fast or not
Using latest sodium-native, discordjs/voice and discordjs/opus
2 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.NodeJs: v20.0.0