AudioResource not playing on Linux
I have a strange issue that I would assume is a dependency mismatch, however everything is in check. I play a URL audio source on my bot that will work on Windows but not on Linux; no errors occur, the audio resource just never plays.
playbackDuration is 0 and .read() returns null. No AudioPlayer error events (or errors in general) are emitted, all the dependencies project-wise are the same, and this resource does work on my own Windows PC. I've also double checked the resource is downloadable from my VPS.
The url points to an mp3 file, so ffmpeg-static is being used.
Below is the dependency list:
6 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.Discord.js 14.11.0 and Node 20.3.1 (20.2.0 on local pc)
looking further into the audioplayer state, it goes immediate from Buffering -> Playing -> Idle. the audioresource is .readable() but has no duration, even though it's 30 seconds
i am now realizing though that playbackDuration is 0 regardless of which PC, and if it's fully buffered or not
@discordjs/voice
does not stream from urls for you
you'll need to fetch/request from the url first
createAudioResource
accepts a readable streami see, so windows is doing that automatically somehow?
no, that's the issue
nothing is currently streaming from the url, therefore your resource is empty
i getcha, i'll fetch it by itself first; now i'm just confused why my local one running on windows does work when just putting in a URL for the input
doing this resolved my problem: