Пример #1
0
        public bool TriggerEnrollment(TriggerEnrollmentRequest request)
        {
            if (!_mirrorStateServices.GetCurrentUser().IsDefaultUser)
            {
                return(false);
            }

            _voiceUseCasesStateService.SetCurrentDetectionState(VoiceUseCasesState.EnrollmentDetection);
            _voiceUseCasesStateService.SetUserForEnrollment(request.SnowUser);
            _mirrorStateServices.SetCurrentUserTo(new MirrorUser(request.SnowUser, false, false, null));
            _deliveryBoundary.DeliverEnrollmentPage();
            return(true);
        }
Пример #2
0
        public void OnNoiseCompleted(NoiseDetectedRequest noiseDetectedRequest)
        {
            //if a user is logged in now change of state!
            if (!_mirrorStateServices.GetCurrentUser().IsDefaultUser)
            {
                return;
            }

            switch (_mirrorStateServices.GetCurrentDetectionState())
            {
            case VoiceUseCasesState.UserDetection:
                _authenticateUserUseCase.Authenticate(noiseDetectedRequest.RecordedAudio);
                break;

            case VoiceUseCasesState.EnrollmentDetection:
                _userEnrollmentUseCase.Enroll(noiseDetectedRequest.RecordedAudio);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }