I've copied the abbriviated code and exception information below. Any input
would be VERY appreciated. I really need a way to get at the raw phonems
(and am hoping to avoid using SAPI directly).
Geo...
m_objEngine = this.GetRecognitionEngine("MS-1033-80-DESK",
CultureInfo.CurrentCulture);
if (m_objEngine is SpeechRecognitionEngine)
{
DictationGrammar objDictationGrammar = new
DictationGrammar("grammar:dictation#Pronunciation");
m_objEngine.LoadGrammar(objDictationGrammar);
string szInputMultimedia = @"C:\audio.wav";
m_objEngine.SetInputToWaveFile(szInputMultimedia);
m_objEngine.RecognizeAsync(RecognizeMode.Multiple);
}
TargetInvocationException
Exception has been thrown by the target of an invocation
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo
method, Object target, Object[] arguments, SignatureStruct& sig,
MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method,
Object target, Object[] arguments, Signature sig, MethodAttributes
methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Speech.Internal.AsyncSerializedWorker.WorkerProc(Object ignored)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Inner Exception: "Value does not fall within the expected range"
at System.Speech.Internal.SapiInterop.ISpRecoResult.GetAlternates(Int32
ulStartElement, Int32 cElements, Int32 ulRequestCount, IntPtr[] ppPhrases,
Int32& pcPhrasesReturned)
at
System.Speech.Recognition.RecognitionResult.ExtractDictationAlternates(ISpRecoResult recoResult, Int32 maxAlternates)
at
System.Speech.Recognition.RecognitionResult.Initialize(IRecognizerInternal
recognizer, ISpRecoResult recoResult, Byte[] sapiResultBlob, Int32
maxAlternates)
at
System.Speech.Recognition.RecognizerBase.CreateRecognitionResult(SpeechEvent
speechEvent)
at
System.Speech.Recognition.RecognizerBase.ProcessRecognitionEvent(SpeechEvent
speechEvent)
at System.Speech.Recognition.RecognizerBase.DispatchEvents(Object
eventData)