The parameter is incorrect when calling new SpeechRecognizerUI()


  • On a brand-new windows 8 phone (tested on two Nokia's) if I call this line in my application:

    recoWithUI = new SpeechRecognizerUI();

    Then I get an exception "The parameter is incorrect." HResult is -2147024809.

    Obviously I haven't yet enabled speech, why am I getting this particular message which doesn't appear to be documented?


    Wednesday, March 27, 2013 3:02 AM

All replies

  • Is there any innerException?

    Can you catch the exception in the debugger?

    If so , what does the stack look like?


    Wednesday, March 27, 2013 7:35 PM
  • I just tried that, with a new 8.0 app and did not get an exception in the emulator or a Nokia Lumia 920, after enabling:

    ID_CAP_SPEECH_RECOGNITION, ID_CAP_MICROPHONE, and ID_CAP_NETWORKING capabilities in the app manifest


    Mark Chamberlain Sr. Escalation Engineer | Microsoft Developer Support | Windows Phone 8

    Wednesday, March 27, 2013 7:50 PM
  • Eric,

    I don't have it open in the debugger in front of me, but as I recall there wasn't any inner exception and the stack just listed the constructor and then my stack.  Will get back to you with confirmed stack once I've got my phone plugged in this afternoon.


    Wednesday, March 27, 2013 7:53 PM
  • Mark,

    Yes, all those things are turned on and speech recognition works as soon as you have selected a language under speech settings on the phone.  At the moment, in my settings the speech language is listed as none (although there are in fact languages installed on the phone, which what my code is trying to use).  The issue reproduces on both the Nokia 920 and 620.


    Wednesday, March 27, 2013 7:55 PM
  • Eric,

    sorry for the delay in replying. I have now confirmed that there is no inner exception and stack trace looks like this:

       at Windows.Phone.Speech.Recognition.SpeechRecognizerUI..ctor()
       at {myfunction}.d__13.MoveNext()

    As I say, as soon as I select the speech-language on the phone, it will work.  It's just surfacing an undocumented error.


    Saturday, March 30, 2013 7:43 PM
  • Does it matter what language is your phone set to, in "language+region" settings, when you get the error?


    Wednesday, April 03, 2013 2:47 PM
  • Apparently not. Just changed it from English New Zealand to English US and the same problem still happens.  But both Nokia's are running Australia New Zealand firmware. Mine specifically Telecom New Zealand and the Nokia 620 the generic Australia New Zealand firmware.
    Wednesday, April 03, 2013 5:45 PM
  • Ok, I've given up on waiting on this this and handled the argumentexception, so that I can actually start using speech on my phone.
    Tuesday, April 16, 2013 3:49 AM