No Audio Is Played
Hello! I'm new to using
@discordjs/voice
so I'm hoping I'm just missing something simple.
I'm trying to get my bot to play a local audio file within voice. The bot joins the channel, but doesn't make a noise.
This is the relevant code:
I was wondering if anyone could point me in the direction of the cause? The bot is auto-pausing so I believe it is do with the resource. Thank you!
[email protected]
@discordjs/[email protected]
node v18.13.030 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Maybe you don't have to unpause the player
because you have already set up required code block of u auto-paused player
Sorry I'm not quite sure I follow what you mean?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I meant you don't have to write player.unpause()
and if you want to do that, you have to listen event that PlayerStatus.AutoPaused event
and
this solve problem that recently changed
so you don't have to unpause the player
right I see, let me have a try
maybe this wont't work
please check the audio path is correctly
Yeah the audio path I've checked, I also tried it with a URL to an mp3 file on the web
Ahh I see
Could you disable debug mode of the player?
Disable, sure.
I just tried removing the
unpause()
but no luckI think so
So try again with
debug
turned off and no unpause()
yeah
No difference unfortunately....
Did you install dependencys?
Such as disrdjs/voice or opusscript or sodium or tweetnacl etc
Do I need opusscript also?
The way I read the documentation was that it was optional if using ffmpeg
No
That's enough
Right
Humm what is the problem?
I have no idea! It just stays on
autopause
Rather frustrating hahalol
Try await createAudioResource
It's not async is it?
I meant
No difference
humm
This is the state changing
ahhh
auto pause caused by NoSubscriberBehavior.Paused
and discord api's recently change
but counteringof api's problem is already set up
what's going ong here?
honestly, not a clue
I feel like I've been going round in circles for 48 hours mate haha
the counter of the API's problem doesnt work for me either. The only thing i have found that fixes it is switching regions which automatically plays the sound the moment u switch it. BUT that is so impractical in a release build for a bot so i never implemented it and now im stuck here with a major feature in my bot not working.
Yeah that does not sound ideal