2

Closed

Speech Recognition won't start up on some Locales

description

Converting this discussion: http://mayhem.codeplex.com/discussions/348614 to a work item.

Having the same problem here. When trying to activate the event-reaction pair, I receive the following error : "Error enabling Speech recognition". I have a working microphone (Skype, GoToWebinar, etc. all work fine). My operating system is Windows 7 64 bits, in French. Could it be because the Speech recognition is not active by default if the OS language is not English?

Thanks in advance for any help you can provide.

file attachments

Closed Mar 18, 2012 at 9:29 PM by TheSavior
Fixed by changing the line in OnEnabling from

engine = new SpeechRecognitionEngine(new CultureInfo("en-US"));

to:

engine = new SpeechRecognitionEngine(CultureInfo.CurrentCulture);

comments

TheSavior wrote Mar 17, 2012 at 8:06 PM

This is an interesting issue. My thought is that it must be the french that is throwing it off. That error message only occurs when an uncaught exception occurs in the OnEnabling method. I've gone through every method call that we make in that method on MSDN looking for what situations could cause them to throw. The only thing that I believe could throw that we aren't try / catching was this line:

engine = new SpeechRecognitionEngine(new CultureInfo("en-US"));

The constructor for CultureInfo can throw if the given name "is not a valid culture name". en-US however is in the official list of culture names, so I'm not sure if different installations have different lists of culture names (this seems crazy).

I've changed that line to be:

try
{
engine = new SpeechRecognitionEngine(new CultureInfo("en-US"));
}
catch
{
ErrorLog.AddError(ErrorType.Failure, "Unable to start up the Speech Recognition Engine");
e.Cancel = true;
return;
}

It would be great if someone who actually had this issue could run Mayhem from the source and see if that solves the problem before I mark it as fixed.

jpgouigoux wrote Mar 18, 2012 at 4:14 PM

I just got the latest download and the correction works fine!
A few remarks, though...

There is a compilation error in SpeechRecognition:
protected override void OnDeleted()
{
    engine.Dispose
}
I corrected it. Can you please do so in the next download?

Also, the OnEnabling code is the following:
try
{
    engine = new SpeechRecognitionEngine(CultureInfo.CurrentCulture);
}
catch
{
    ErrorLog.AddError(ErrorType.Failure, "Unable to start up the Speech Recognition Engine");
    e.Cancel = true;
    return;
}
The code is correct (it works), but this is not what is written in the description of the issue on the website. That might be confusing for someone.

Finally, it could be worse explaining somewhere in the Speech-related documentation that Windows Speech Recognition has to be started (that might sound obvious, but some may imagine that Mayhem includes its own voice recognition system), but does not necessarily need to be in active mode. I noticed Mayhem can work with the Speech recognition being started but disabled.

Thanks for the quick correction! Very appreciated :-) I check the code and, outside AssemblyInfo Culture, there is no remaining "en-US" forced culture.

Cheers,

JP

TheSavior wrote Mar 18, 2012 at 6:52 PM

Awesome, I'm glad those worked. Can you elaborate a little bit more on "The code is correct (it works), but this is not what is written in the description of the issue on the website. That might be confusing for someone." and also what you mean with Mayhem working with speech recognition started but disabled?

You shouldn't need to run the speech recognition that comes with Windows, all of that should be handled inside of Mayhem. Do you mean that there is a way to disable speech recognitions from the control panel that breaks the event? If so then that is something we should be able to fix.

jpgouigoux wrote Mar 18, 2012 at 8:37 PM

On the first part of your mail: on your note from Saturday, 8:06, you write that you changed the line to "... en-US...", whereas the actual correction was "CurrentCulture" (which is indeed what is written in the code).

On the second part of your mail: this is my mistake. I tried first without running the speech recognizer from Windows and it did not work. Then I started it, and it worked on my second try, so I jumped to the conclusion that the speech recognizer had to be started for Mayhem to work. I guess what happened simply was that I did not pronunce the word right the first time.

As for the difference between active and enabled, you will find attached a screenshot of the Speech Recognizer (not sure this is the name in English) : it is activated, since it is ready to recognize voice, but disabled temporarily (typically when telling one's children to STOP, in order to avoid the computer to understand it should halt - yes, this is real life). But since Speech recognition only needs to be configured in Windows and this tool is not necessary for Mayhem, this is irrelevant. Just for info.

Thanks for the follow-up

JP

luguen wrote Mar 30, 2012 at 1:10 PM

Hello,

when will be the next release for those who are not developpers (and only use the developper preview) ?

Thank you,
Bertrand

TheSavior wrote Mar 30, 2012 at 4:42 PM

Hi luguen, We are hoping to release an update to DefaultModules pretty soon. I'm hoping the timeframe is within the next week / week and a half. Once there is an update, this will be pushed to users automatically when they open the Mayhem application.

thieumax wrote May 11, 2012 at 12:52 AM

Hi Guys !

i have a french windows 7 bersion, and i have the same issue... i just downloaded the software package yesterday. it seems that the problem is not corrected...

thanks

thieumax wrote May 11, 2012 at 12:54 AM

Hi guys,



i have a french windows 7 install, and i have the same problem...



can you help ?



thanx

thieumax wrote Aug 10, 2012 at 1:09 AM

Hi Guys !
since now, it doesn't work. i have the same problem, and it's not fixed... can you please upload the right coonfig file in the package ?
thanks to let open a non solved issue.

regards