Mp3 audio not playing
Hello i followed various guides and threads in this server to create a command !play that enables the bot to stream an mp3 file located in his folder. The bot joins the channel but the audio don't start, no errors in the terminal.
[email protected]
Node v16.20.2
@discordjs/[email protected]
@discordjs/[email protected]
14 Replies
- 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!first before debugging, please try updating
@discordjs/voice
latest version is 0.17.0
0.7.5
is a little outdatedTo debug your voice connection and player:
- Use
debug: true
when creating your VoiceConnection
and AudioPlayer
- Add an event listener to the <VoiceConnection> and the <AudioPlayer>:
- Add an error
listener to the stream you are passing to the resource:
Note: The <>
represents classes that need to be adapted to their respective name in your code
thank you, no changes updating voice.
here the debug results:
in the main folder of my project there is a folder named music with the file inside.
I've tride to use absolute path now, but nothing changed, no audio. here the actual code
no changes with this path
also with this path, no audio
i've installed ffmpeg a few months ago and i don't remember how. i've also installed ffmpeg-static via npm recently.
what's the correct method to install it?
- npm:
npm install ffmpeg-static
- Install: Download | chocolatey | homebrew | your distributions package manager
- Tutorial: YouTube
- ffmpeg-binaries is deprecated, uninstall it with npm rm ffmpeg-binaries
so what should I do?
your player seems to autopause and never resume
this just means that your player doesn't think your connection is ready which is most commonly caused by missing the
GuildVoiceStates
intent, but the subsequent logs would indicate otherwise
without any further information, I'd guess it's a network issue, but I do also see tweetnacl
seems to be a little out of date as well (latest being 1.0.3
)
couldn't hurt to update (or even switch encryption libs), even if likely unrelatedupdated, but no changes, no audio from the bot..
sorry, any solution for our problem?
yo?
Are you supposed to have three slashes after
file:
?
Maybe try doing file://C:
etc 🤷♂️tried but no results
Solutions???
I seem to have the same issue - except the voice activity goes green from the bot, but no audio (voice activity also stops once the mp3 is finished "playing", and the debug output shows the connection going from
playing
to idle
). My guess is that either the resource isn't getting setup properly (although it seems odd that the player would just stream silence instead of failing more loudly); or I have a configuration issue with discord. Computer audio is fine since I hear the joined
earcon when the bot joins the channel . . .
omg so dumb. Evidently, alerts go to system sound while Discord app has different settings for voice I/O. Changed it to the correct output and it works!
fwiw, I followed the example here:
https://github.com/discordjs/voice-examples/blob/main/basic/src/main.ts