cyberieur
Posts: 5
Joined: Thu Jan 17, 2013 10:05 pm

[C#] Problem with System.Speech

Sat Feb 09, 2013 11:40 pm

Hello

When I run my program of speech recognition in C #, I get this error:

Code: Select all

Unhandled Exception: System.DllNotFoundException: ole32.dll
  at (wrapper managed-to-native) System.__ComObject:CoCreateInstance (System.Guid,intptr,uint,System.Guid,intptr&)
  at System.__ComObject.Initialize (System.Type t) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.__ComObject:Initialize (System.Type)
  at Mono.Interop.ComInteropProxy.CreateProxy (System.Type t) [0x00000] in <filename unknown>:0
  at System.Runtime.Remoting.RemotingServices.CreateClientProxyForComInterop (System.Type type) [0x00000] in <filename unknown>:0
  at System.Runtime.Remoting.Activation.ActivationServices.CreateProxyForType (System.Type type) [0x00000] in <filename unknown>:0
  at System.Speech.Internal.SapiInterop.SapiRecognizer..ctor (RecognizerType type) [0x00000] in <filename unknown>:0
  at System.Speech.Recognition.SpeechRecognitionEngine.Initialize (System.Speech.Recognition.RecognizerInfo recognizerInfo) [0x00000] in <filename unknown>:0
  at System.Speech.Recognition.SpeechRecognitionEngine..ctor () [0x00000] in <filename unknown>:0
  at speechreco.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: ole32.dll
  at (wrapper managed-to-native) System.__ComObject:CoCreateInstance (System.Guid,intptr,uint,System.Guid,intptr&)
  at System.__ComObject.Initialize (System.Type t) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.__ComObject:Initialize (System.Type)
  at Mono.Interop.ComInteropProxy.CreateProxy (System.Type t) [0x00000] in <filename unknown>:0
  at System.Runtime.Remoting.RemotingServices.CreateClientProxyForComInterop (System.Type type) [0x00000] in <filename unknown>:0
  at System.Runtime.Remoting.Activation.ActivationServices.CreateProxyForType (System.Type type) [0x00000] in <filename unknown>:0
  at System.Speech.Internal.SapiInterop.SapiRecognizer..ctor (RecognizerType type) [0x00000] in <filename unknown>:0
  at System.Speech.Recognition.SpeechRecognitionEngine.Initialize (System.Speech.Recognition.RecognizerInfo recognizerInfo) [0x00000] in <filename unknown>:0
  at System.Speech.Recognition.SpeechRecognitionEngine..ctor () [0x00000] in <filename unknown>:0
  at speechreco.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
To start my program I first download System.Speech.dll otherwise I had this error:

Code: Select all

Program.cs(5,14): error CS0234: The type or namespace name `Speech' does not exist in the namespace `System'. Are you missing an assembly reference?
Then I made this command to compile:

Code: Select all

mcs Program.cs -r:System.Speech.dll
And to launch I did this command:

Code: Select all

mono Program.exe
How to fix the error?
I was handling it good to start my program?
Where does the error?

sorry for my bad english

Thank you in advance.

User avatar
bfagioli
Posts: 123
Joined: Sat Oct 27, 2012 11:49 pm

Re: [C#] Problem with System.Speech

Sun Feb 10, 2013 4:57 am

First of all which Pi distro are you using. If you are using Raspbian “wheezy” there are many know issues with mono and this distro. Many of us are waiting for an updated version of mono that better supports this hard-float distro. Although I don't use it, I have been told the Soft-float Debian “wheezy” supports mono much better so you might want to try that if you have an extra SD card.

However, the error you are seeing looks like the Speech assembly want to CoCreate a COM object. I'm not sure if COM objects are even supported on non-Microsoft systems so this may never work. I think there is a mono tool you can run to determine if your program is "compatible" with mono. Can't remember it right now.

Code: Select all

Unhandled Exception: System.DllNotFoundException: ole32.dll at (wrapper managed-to-native) System.__ComObject:CoCreateInstance 
Looks like

stever29
Posts: 5
Joined: Wed Feb 27, 2013 6:57 pm

Re: [C#] Problem with System.Speech

Wed Feb 27, 2013 7:01 pm

From what you've said, it sounds like you've downloaded the windows implementation of the System.Speech assembly.. you need the mono one for any chance in getting this to work.

Nevertheless, have you had any luck with this since you posted? I'm keen to do the same thing, but its unclear to me which version (if any) of mono has this implemented

Return to “C/C++”