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:
Connection transitioned from signalling to signalling
Audio player transitioned from idle to buffering
Audio player transitioned from buffering to playing
Audio player transitioned from playing to autopaused
Connection transitioned from signalling to signalling
Audio player transitioned from idle to buffering
Audio player transitioned from buffering to playing
Audio player transitioned from playing to autopaused
And here is the recommended debug text:
--------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.18.0
- prism-media: 1.3.5

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

Encryption Libraries
- sodium-native: not found
- sodium: not found
- libsodium-wrappers: 0.7.15
- @stablelib/xchacha20poly1305: not found
- @noble/ciphers: not found

FFmpeg
- version: 6.0-essentials_build-www.gyan.dev
- libopus: yes
--------------------------------------------------
--------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.18.0
- prism-media: 1.3.5

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

Encryption Libraries
- sodium-native: not found
- sodium: not found
- libsodium-wrappers: 0.7.15
- @stablelib/xchacha20poly1305: not found
- @noble/ciphers: not found

FFmpeg
- version: 6.0-essentials_build-www.gyan.dev
- libopus: yes
--------------------------------------------------
Any experience with what could be happening? https://gist.github.com/madebomb25/73d7308fa0ae3f48fd420f3b1d098210
Gist
playsound.js
GitHub Gist: instantly share code, notes, and snippets.
11 Replies
d.js toolkit
d.js toolkit4d ago
- 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!
WhiteGarfield
WhiteGarfield3d ago
first thing that catches my eye, is a old version of ffmpeg. please update it to have the 7.1 build
MadeBomb
MadeBombOP2d ago
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?
WhiteGarfield
WhiteGarfield2d ago
dont use the ffmpeg static. <- it only works up to 6.0 ffmpeg everything above does not wirk work*
MadeBomb
MadeBombOP2d ago
alright, then ill try downloading the normal one. Lets see what happens
WhiteGarfield
WhiteGarfield2d ago
yea. remove static completely and just install regular ffmpeg
MadeBomb
MadeBombOP2d ago
It still does not work.
--------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.18.0
- prism-media: 1.3.5

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

Encryption Libraries
- sodium-native: not found
- sodium: not found
- libsodium-wrappers: 0.7.15
- @stablelib/xchacha20poly1305: not found
- @noble/ciphers: not found

FFmpeg
- version: 2025-01-20-git-504df09c34-full_build-www.gyan.dev
- libopus: yes
--------------------------------------------------
--------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.18.0
- prism-media: 1.3.5

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

Encryption Libraries
- sodium-native: not found
- sodium: not found
- libsodium-wrappers: 0.7.15
- @stablelib/xchacha20poly1305: not found
- @noble/ciphers: not found

FFmpeg
- version: 2025-01-20-git-504df09c34-full_build-www.gyan.dev
- libopus: yes
--------------------------------------------------
(I downloaded the latest package for Windows by the link on the discordjs voice page)
Connection transitioned from signalling to signalling
Audio player transitioned from idle to buffering
Audio player transitioned from buffering to playing
Audio player transitioned from playing to autopaused
Connection transitioned from signalling to signalling
Audio player transitioned from idle to buffering
Audio player transitioned from buffering to playing
Audio player transitioned from playing to autopaused
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
WhiteGarfield
WhiteGarfield2d ago
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
2025-01-20-git-504df09c34-full_build-www.gyan.dev
2025-01-20-git-504df09c34-full_build-www.gyan.dev
MadeBomb
MadeBombOP2d ago
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
WhiteGarfield
WhiteGarfield2d ago
yea lemme know
MadeBomb
MadeBombOP13h ago
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

Did you find this page helpful?