Esempio n. 1
0
        public async void SendSpeaking(int speaking)
        {
            DownstreamEvents.Speak Event = new DownstreamEvents.Speak
            {
                Speaking = speaking,
            };
            Speak?.Invoke(this, new VoiceConnectionEventArgs <DownstreamEvents.Speak>(Event));

            var speakingPacket = new SocketFrame
            {
                Operation = OperationCode.Speaking.ToInt(),
                Payload   = new UpstreamEvents.Speak()
                {
                    Speaking = speaking,
                    Delay    = 0,
                    SSRC     = lastReady?.SSRC ?? 0,
                },
            };
            await _webMessageSocket.SendJsonObjectAsync(speakingPacket);
        }
Esempio n. 2
0
        public async void SendSpeaking(bool speaking)
        {
            DownstreamEvents.Speak Event = new DownstreamEvents.Speak
            {
                Speaking = speaking
            };
            Speak?.Invoke(this, new VoiceConnectionEventArgs <DownstreamEvents.Speak>(Event));
            if (speaking == false)
            {
                SendSilence();
            }

            var speakingPacket = new SocketFrame
            {
                Operation = OperationCode.Speaking.ToInt(),
                Payload   = new UpstreamEvents.Speak()
                {
                    Speaking = speaking,
                    Delay    = 0,
                    SSRC     = lastReady != null ? lastReady.SSRC : 0
                }
            };
            await _webMessageSocket.SendJsonObjectAsync(speakingPacket);
        }