From dff93e103adf03b25e85ab753693479878c4efbf Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 3 Jan 2023 19:57:38 -0500 Subject: actually go to connected state and transmit data --- src/discord/voiceclient.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/discord/voiceclient.cpp b/src/discord/voiceclient.cpp index 7e801f7..379a65c 100644 --- a/src/discord/voiceclient.cpp +++ b/src/discord/voiceclient.cpp @@ -154,7 +154,9 @@ DiscordVoiceClient::DiscordVoiceClient() auto &audio = Abaddon::Get().GetAudio(); audio.SetOpusBuffer(m_opus_buffer.data()); audio.signal_opus_packet().connect([this](int payload_size) { - // SendEncrypted if udp is connected + if (IsConnected()) { + m_udp.SendEncrypted(m_opus_buffer.data(), payload_size); + } }); }); } @@ -307,6 +309,8 @@ void DiscordVoiceClient::HandleGatewaySessionDescription(const VoiceGatewayMessa m_udp.SetSecretKey(m_secret_key); m_udp.SendEncrypted({ 0xF8, 0xFF, 0xFE }); m_udp.Run(); + + SetState(State::Connected); } void DiscordVoiceClient::HandleGatewaySpeaking(const VoiceGatewayMessage &m) { -- cgit v1.2.3