Пример #1
0
        /// <summary>
        /// Sends a given DiscordAudioPacket over the UDP client..
        /// </summary>
        /// <param name="packet"></param>
        /// <returns></returns>
        public async Task SendPacket(DiscordAudioPacket packet)
        {
            if (_udp != null && VoiceWebSocket.State == WebSocketState.Open)
            {
#if NETFX4_5
                await _udp.SendAsync(packet.AsRawPacket(), packet.AsRawPacket().Length).ConfigureAwait(false);
#else
                _udp.Send(packet.AsRawPacket(), packet.AsRawPacket().Length);
#endif
                VoiceDebugLogger.Log("Sent packet through SendPacket task.", MessageLevel.Unecessary);
            }
        }
Пример #2
0
 /// <summary>
 /// Echos a given DiscordAudioPacket.
 /// </summary>
 /// <param name="packet"></param>
 /// <returns></returns>
 public async Task EchoPacket(DiscordAudioPacket packet)
 {
     await SendPacket(DiscordAudioPacket.EchoPacket(packet.AsRawPacket(), Params.ssrc)).ConfigureAwait(false);
 }