예제 #1
0
        /// <summary>
        ///     Queues an encoded audio frame for playback in the current session.
        /// </summary>
        /// <param name="packet"></param>
        /// <param name="now">The current time (or null, to use DateTime.Now)</param>
        public void ReceiveFrame(VoicePacket packet, DateTime?now = null)
        {
            if (packet.SenderPlayerId != PlayerName)
            {
                throw Log.CreatePossibleBugException(string.Format("Attempted to deliver voice from player {0} to playback queue for player {1}", packet.SenderPlayerId, PlayerName), "F55DB7D5-621B-4F5B-8C19-700B1FBC9871");
            }

            var delay = _active.Push(packet, now ?? DateTime.UtcNow);

            _arrivalJitterMeter.Update(delay);
        }
예제 #2
0
        /// <summary>
        ///     Queues an encoded audio frame for playback in the current session.
        /// </summary>
        /// <param name="packet"></param>
        /// <param name="now">The current time (or null, to use DateTime.Now)</param>
        public void ReceiveFrame(VoicePacket packet, DateTime?now = null)
        {
            if (packet.SenderPlayerId != PlayerName)
            {
                throw Log.CreatePossibleBugException(string.Format("Attempted to deliver voice from player {0} to playback queue for player {1}", packet.SenderPlayerId, PlayerName), "F55DB7D5-621B-4F5B-8C19-700B1FBC9871");
            }

            if (_active == null)
            {
                Log.Warn(Log.PossibleBugMessage(string.Format("Attempted to deliver voice from player {0} with no active session", packet.SenderPlayerId), "1BD954EC-B455-421F-9D6E-2E3D087BC0A9"));
                return;
            }

            var delay = _active.Push(packet, now ?? DateTime.UtcNow);

            Metrics.Sample(_metricArrivalDelay, delay);

            _arrivalJitterMeter.Update(delay);
        }