63 references to SAPIErrorCodes
System.Speech (63)
Internal\SapiInterop\SapiGrammar.cs (4)
53internal SAPIErrorCodes SetDictationState(SPRULESTATE state) 55return (SAPIErrorCodes)_sapiProxy.Invoke(delegate { return _sapiGrammar.SetDictationState(state); })!; 58internal SAPIErrorCodes SetRuleState(string? name, SPRULESTATE state) 60return (SAPIErrorCodes)_sapiProxy.Invoke(delegate { return _sapiGrammar.SetRuleState(name, IntPtr.Zero, state); })!;
Internal\SapiInterop\SapiInterop.cs (8)
62internal static SRID SapiErrorCode2SRID(SAPIErrorCodes code) 64if (code >= SAPIErrorCodes.SPERR_FIRST && code <= SAPIErrorCodes.SPERR_LAST) 66return (SRID)((int)SRID.SapiErrorUninitialized + (code - SAPIErrorCodes.SPERR_FIRST)); 72case SAPIErrorCodes.SP_NO_RULE_ACTIVE: 75case SAPIErrorCodes.SP_NO_RULES_TO_ACTIVATE: 78case SAPIErrorCodes.SP_NO_PARSE_FOUND: 81case SAPIErrorCodes.S_FALSE:
Internal\SapiInterop\SapiRecognizer.cs (14)
164internal SAPIErrorCodes EmulateRecognition(string? phrase) 167return (SAPIErrorCodes)_proxy.Invoke(delegate { return _proxy.SapiSpeechRecognizer.EmulateRecognition(phrase, ref displayAttributes, 0); })!; 170internal SAPIErrorCodes EmulateRecognition(ISpPhrase iSpPhrase, uint dwCompareFlags) 172return (SAPIErrorCodes)_proxy.Invoke(delegate { return _proxy.Recognizer2.EmulateRecognitionEx(iSpPhrase, dwCompareFlags); })!; 203SAPIErrorCodes errorCode; 207errorCode = (SAPIErrorCodes)sapiRecognizer.SetPropertyNum(name, (int)value); 211errorCode = (SAPIErrorCodes)sapiRecognizer.SetPropertyString(name, (string)value); 214if (errorCode == SAPIErrorCodes.S_FALSE) 218else if (errorCode < SAPIErrorCodes.S_OK) 226SAPIErrorCodes errorCode; 232errorCode = (SAPIErrorCodes)sapiRecognizer.GetPropertyNum(name, out value); 238errorCode = (SAPIErrorCodes)sapiRecognizer.GetPropertyString(name, out value); 242if (errorCode == SAPIErrorCodes.S_FALSE) 246else if (errorCode < SAPIErrorCodes.S_OK)
Recognition\RecognizerBase.cs (36)
457if (!_supportsSapi53 && (SAPIErrorCodes)e.ErrorCode == SAPIErrorCodes.SPERR_NOT_FOUND) 569throw ExceptionFromSapiStreamError((SAPIErrorCodes)comException.ErrorCode); 869return ExceptionFromSapiCreateRecognizerError((SAPIErrorCodes)e.ErrorCode); 872internal static Exception ExceptionFromSapiCreateRecognizerError(SAPIErrorCodes errorCode) 877case SAPIErrorCodes.CLASS_E_CLASSNOTAVAILABLE: 878case SAPIErrorCodes.REGDB_E_CLASSNOTREG: 893case SAPIErrorCodes.SPERR_SHARED_ENGINE_DISABLED: 894case SAPIErrorCodes.SPERR_RECOGNIZER_NOT_FOUND: 1457switch ((SAPIErrorCodes)e.ErrorCode) 1459case SAPIErrorCodes.SPERR_NOT_FOUND: 1466ThrowIfSapiErrorCode((SAPIErrorCodes)e.ErrorCode); 1548return (int)SAPIErrorCodes.SPERR_INVALID_IMPORT; 1605switch ((SAPIErrorCodes)e.ErrorCode) 1607case SAPIErrorCodes.SPERR_UNSUPPORTED_FORMAT: 1611case SAPIErrorCodes.SPERR_INVALID_IMPORT: 1615case SAPIErrorCodes.SPERR_TOO_MANY_GRAMMARS: 1619case SAPIErrorCodes.SPERR_NOT_FOUND: 1624case ((SAPIErrorCodes)(-1)): 1629ThrowIfSapiErrorCode((SAPIErrorCodes)e.ErrorCode); 1633ThrowIfSapiErrorCode((SAPIErrorCodes)e.ErrorCode); 1908SAPIErrorCodes hr = SapiRecognizer.EmulateRecognition(iSpPhrase, (uint)(flag)); 1909if (hr != SAPIErrorCodes.S_OK) 1926SAPIErrorCodes hr = SapiRecognizer.EmulateRecognition(phrase); 1927if (hr != SAPIErrorCodes.S_OK) 1934private void EmulateRecognizedFailReportError(SAPIErrorCodes hr) 1948if ((int)hr < 0 || hr == SAPIErrorCodes.SP_NO_RULE_ACTIVE) 1960SAPIErrorCodes errorCode; 1970if (errorCode is SAPIErrorCodes.SPERR_NOT_TOPLEVEL_RULE or SAPIErrorCodes.SP_NO_RULES_TO_ACTIVATE) 1997else if (errorCode != SAPIErrorCodes.SPERR_AUDIO_NOT_FOUND && errorCode < 0) 2056exception = ExceptionFromSapiStreamError((SAPIErrorCodes)comException.ErrorCode); 2475FireRecognizeCompletedEvent(lastResult, initialSilenceTimeoutReached, babbleTimeoutReached, isStreamReleased, speechEvent.AudioPosition, (speechEvent.LParam == 0) ? null : ExceptionFromSapiStreamError((SAPIErrorCodes)speechEvent.LParam), isRecognizeCancelled); 2489FireEmulateRecognizeCompletedEvent(lastResult, (speechEvent.LParam == 0) ? lastException : ExceptionFromSapiStreamError((SAPIErrorCodes)speechEvent.LParam), isRecognizeCancelled); 2619private static void ThrowIfSapiErrorCode(SAPIErrorCodes errorCode) 2629private static Exception ExceptionFromSapiStreamError(SAPIErrorCodes errorCode)
Result\RecognitionResult.cs (1)
130if (ex.ErrorCode == (int)SAPIErrorCodes.SPERR_NOT_SUPPORTED_FOR_INPROC_RECOGNIZER)