No audio on Windows 11 when playing mp3 file
(following the official guide in https://discordjs.guide/voice/audio-resources.html)
I was setting a simple command for playing an .mp3 file (readed that FFmpeg can handle it), but no sound is heard in the voice channel. The bot can join the channel without any errors and load the file, but it 'pauses' the music the instant it joins. I also tried with other file types like Ogg or the recommended Opus versions. Nothing worked. I made all the code in the command file (i thought it was okay and didnt require to made changes to the main.js file).
The bot has admin permissions just in case.
Here is debug texts of the 'execution' function of the command:
And here is the recommended debug text:
Any experience with what could be happening?
https://gist.github.com/madebomb25/73d7308fa0ae3f48fd420f3b1d098210
11 Replies
- 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!first thing that catches my eye, is a old version of ffmpeg. please update it to have the 7.1 build
well, i tried by updating it with 'npm update' (im using ffmpeg-static, the one recommended for npm), but it says is the latest version. Maybe im not meant to use the npm package of ffmpeg anymore?
dont use the ffmpeg static. <- it only works up to 6.0 ffmpeg everything above does not wirk
work*
alright, then ill try downloading the normal one. Lets see what happens
yea. remove static completely and just install regular ffmpeg
It still does not work.
(I downloaded the latest package for Windows by the link on the discordjs voice page)
Same debug text
Idk, the terminal isnt giving me any errors and the error listeners should be placed right. Im also trying to play different files (in case that one was an issue) and still not giving me any audio.
Could be that the code on the guide page is outdated? I hightly doubt that, but id see the mistake in the code
what you can try is using ffmpeg manually in the console so see if Windows in your case is at least able to get a stream (ffmpeg -i "STREAM_URL" -vf showinfo -f null -
) if this shows nothing, that will mean that you have to install ffmpeg on your windows, and if it shows something, try to run the code without
The thing is that i already installed it and added to PATH. It works as it should
im able to convert between music files and do stuff with the library without issues. Only fails with discord XD
Imma try your command, lets see if i can get more info
yea lemme know
Sorry for the wait, i got bussy XD. The command works. I used it on the song file for testing and it is able to recognice it and give details about it
so isnt a ffmpeg issue. I installed it natively on my Windows and added it to PATH, so it is not the problem
Ill try a different approach. I think there are some example files already made on the github repo, so i will try looking if there is something different than in my code. Maybe some update made the actual guide outdated and thats why it does not work anymore