question about voice receiver
hey im trying to make a voice recorder bot and i just wanted to know the stream of audio which i get from
connection.receiver.speaking.on(start)
event, it only emits when someone is speaking and is "silent" or doesnt emit when no one is speaking, and it only lasts for the duration of someone is speaking right?2 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!the
start
event doesn't emit the stream itself, and I'm also not really sure what you mean by "it only lasts for the duration of someone is speaking" since events don't really have durations
the start
SpeakingMap
event emits when a user starts speaking
as documented, it emits with the id of the user who started speaking
<VoiceReceiver>.subscribe()
would be the method you'd use to actually receive an AudioReceiveStream
(an opus packet stream) for a given user id
it can be called whenever you like, including upon receiving the start
event
it will end depending on the behavior
you specify in the end
option for <VoiceReceiver>.subscribe()
iirc the default behavior is end after 5 seconds of silence