receiving audio from a user and playing it with ffplay
This is my code:
It looks like the subscription is giving audio but the ffplay is not playing it.
10 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.sorry, its [email protected]
and also @discordjs/[email protected]
its all defined, no errors, ffplay is installed and its working out of the code
node version is v19.7.0
Is it possible that when your bot joins the channel it mutes its self
selfDeaf is for the bot to hear, def true
selfMute is for the bot to talk, def false
its also getting the packets, ffplay is just not playing them
I see i am getting ignored
this isn't ffplay support, but I imagine it doesn't support playing an opus packet stream
you can utilize the
opus.Decoder
class from prism-media
(which @discordjs/voice
depends on) to decode the opus packet stream to pcm
https://amishshah.github.io/prism-media/opus.Decoder.htmlty
this is the updated version, it does actually pop up a ffplay window but the audio is just bunch of random noises, "whitenoice"?
you'll probably need some extra ffplay args to specify the format of what you're playing
but this is leaving the scope of this channel
All fixed, thank you
One more thing, can the bot recrod the whole voice room and hot just 1 user?
there is no method for receiving all users in the voice channel as 1 stream if that's what you're asking
you can call
<VoiceReceiver>.subscribe()
as many times as you wantSo i have to add a logic for when the user leaves channel, joins channel, types the command? cool