Exemplo n.º 1
0
 private SpeechSession(SessionContext context, IJitterEstimator jitter, IDecoderPipeline pipeline, DateTime now)
 {
     _context      = context;
     _pipeline     = pipeline;
     _creationTime = now;
     _jitter       = jitter;
 }
Exemplo n.º 2
0
        private SpeechSession(SessionContext context, IJitterEstimator jitter, IDecoderPipeline pipeline, IRemoteChannelProvider channels, DateTime now)
        {
            _context      = context;
            _pipeline     = pipeline;
            _channels     = channels;
            _creationTime = now;
            _jitter       = jitter;

            _startTime = now;
        }
Exemplo n.º 3
0
        private SpeechSession(SessionContext context, IJitterEstimator jitter, IDecoderPipeline pipeline, IRemoteChannelProvider channels, DateTime now)
        {
            _context      = context;
            _pipeline     = pipeline;
            _channels     = channels;
            _creationTime = now;
            _jitter       = jitter;

            _minimumDelay = (float)(MinimumDelayFactor * _pipeline.InputFrameTime.TotalSeconds);

            Log.Debug("Created speech session with min delay={0}s", _minimumDelay);
        }
Exemplo n.º 4
0
        /// <summary>
        ///     Starts a new speech session and adds it to the queue for playback
        /// </summary>
        /// <param name="format">The frame format.</param>
        /// <param name="now">Current time, or null for DateTime.UtcNow</param>
        /// <param name="jitter">Jitter estimator, or null for this stream to estimate it's own jitter</param>
        public void StartSession(FrameFormat format, DateTime?now = null, [CanBeNull] IJitterEstimator jitter = null)
        {
            if (PlayerName == null)
            {
                throw Log.CreatePossibleBugException("Attempted to `StartSession` but `PlayerName` is null", "0C0F3731-8D6B-43F6-87C1-33CEC7A26804");
            }

            _active = GetOrCreateDecoderPipeline(format, _volumeProvider);

            var session = SpeechSession.Create(new SessionContext(PlayerName, unchecked (_currentId++)), jitter ?? this, _active, _active, now ?? DateTime.UtcNow);

            _awaitingActivation.Enqueue(session);

            Log.Debug("Created new speech session with buffer time of {0}ms", session.Delay.TotalMilliseconds);
        }
Exemplo n.º 5
0
 internal static SpeechSession Create(SessionContext context, IJitterEstimator jitter, IDecoderPipeline pipeline, IRemoteChannelProvider channels, DateTime now)
 {
     return(new SpeechSession(context, jitter, pipeline, channels, now));
 }
Exemplo n.º 6
0
 internal static SpeechSession Create(SessionContext context, IJitterEstimator jitter, IDecoderPipeline pipeline, DateTime now)
 {
     return(new SpeechSession(context, jitter, pipeline, now));
 }