mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Include ssrc parameter when sending a SPEAKING payload
As it is a required parameter. Don't unnecessarily send a second SPEAKING payload after connecting to voice We do need to send a SPEAKING payload in order to set our SSRC value after connecting to voice, yet that can be with a `state` of 0 (SpeakingState.none). There is no reason to send 2 packets; one marking ourselves as speaking, and then not speaking.
This commit is contained in:
parent
08d668f21b
commit
8ba830eeb8
@ -915,6 +915,7 @@ class DiscordVoiceWebSocket:
|
||||
'd': {
|
||||
'speaking': int(state),
|
||||
'delay': 0,
|
||||
'ssrc': self._connection.ssrc,
|
||||
},
|
||||
}
|
||||
|
||||
@ -990,7 +991,11 @@ class DiscordVoiceWebSocket:
|
||||
async def load_secret_key(self, data: Dict[str, Any]) -> None:
|
||||
_log.debug('received secret key for voice connection')
|
||||
self.secret_key = self._connection.secret_key = data['secret_key']
|
||||
await self.speak()
|
||||
|
||||
# Send a speak command with the "not speaking" state.
|
||||
# This also tells Discord our SSRC value, which Discord requires
|
||||
# before sending any voice data (and is the real reason why we
|
||||
# call this here).
|
||||
await self.speak(SpeakingState.none)
|
||||
|
||||
async def poll_event(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user