protected void ResetVerifier() { SessionId = ""; Codec = WaveFormatEncoding.Unknown; Profiles.Clear(); VerifyResults.Clear(); VerifyRawResult = SpeechVerifier.Result.NeedMore; MetaData.Clear(); ExtraData.Clear(); Content.Clear(); CookieContainer = new CookieContainer(); TotalSnippetsSent = 0; TotalAudioBytesSent = 0; TotalProcessCalls = 0; SpeechRequired = 0; SpeechExtracted = 0; VerifyScore = 0; IsSessionOpen = false; IsSessionClosing = false; IsAuthorized = false; IsOverridable = false; IsLivenessRequired = false; LivenessResult = SpeechVerifier.AliveResult.Untested; IsTooSoft = false; IsTooLoud = false; }
protected void AddResult(uint index, string name, SpeechVerifier.InstanceResult result) { SpeechVerifier.Profile profile = Profiles[index]; if (result.Result == SpeechVerifier.Result.Unknown) { if (result.Score == 0.0) { result.Result = SpeechVerifier.Result.NotScored; } else if (result.Score >= profile.PassThreshold) { result.Result = SpeechVerifier.Result.Pass; } else if (result.Score <= profile.FailThreshold) { result.Result = SpeechVerifier.Result.Fail; } else { result.Result = SpeechVerifier.Result.Ambiguous; } } Logger?.LogDebug("SpeechVerifierBase.AddResult(): {0} - Index: {1}", name, index); Logger?.LogDebug("SpeechVerifierBase.AddResult(): {0} - Error: {1}", name, result.ErrorCode); Logger?.LogDebug("SpeechVerifierBase.AddResult(): {0} - Score: {1}", name, result.Score); Logger?.LogDebug("SpeechVerifierBase.AddResult(): {0} - SpeechExtracted: {1}", name, result.SpeechExtracted); Logger?.LogDebug("SpeechVerifierBase.AddResult(): {0} - Result: {1}", name, result.Result); if (result.IsOverridable.HasValue) { IsOverridable = result.IsOverridable.Value; Logger?.LogDebug("SpeechVerifierBase.AddResult(): {0} - IsOverridable: {1}", name, IsOverridable); } if (result.IsAuthorized.HasValue) { IsAuthorized = result.IsAuthorized.Value; Logger?.LogDebug("SpeechVerifierBase.AddResult(): {0} - IsAuthorized: {1}", name, IsAuthorized); } foreach (var extra in result.Extra) { Logger?.LogDebug("SpeechVerifierBase.AddResult(): {0} - {1}: {2}", name, extra.Key, extra.Value); } VerifyResults.Add(name, result); }