3

I'm using Microsoft.Speech (NOT System.Speech!) and I'm trying to set the input of the audio stream to my microphone, which is the default audio device, but it is throwing the exception:

System.InvalidOperationException' occurred in Microsoft.Speech.dll but was not handled in user code`

Additional information: Cannot find the requested data item, such as a data key or value.

This was just a test, ideally I want to set the audio stream to my speakers, but if I can get this to work I can just use a virtual audio device software to plug into the mic stream. If anyone can also set the audio stream to the speakers directly, that would be perfect.

Your help is appreciated!

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
rakagunarto
  • 325
  • 3
  • 23
  • Whoever downvoted my question, may I please know why? Because I have spent 6 hours looking for the answer to this question and finally I ask here and it gets downvoted. – rakagunarto Oct 24 '15 at 15:07
  • There is same question asked before already http://stackoverflow.com/questions/32961817/microsoft-speech-recognition-setinputtodefaultaudiodevice-throws-exception – Nikolay Shmyrev Oct 25 '15 at 09:26
  • According to the information in the network this exception occurs when you have no available microphone. You need to check that you can actually record audio. – Nikolay Shmyrev Oct 25 '15 at 09:29
  • @NikolayShmyrev If I use the System.Speech namespace, it works fine, but if I use Microsoft.Speech, it throws the exception, so I know my recording device works fine. And that question has no reply – rakagunarto Oct 25 '15 at 09:47

1 Answers1

1

Based on limited information on the net, the situation is the following. Microsoft.Speech recognizer is recognizer for servers, like VXML servers and it might not support all audio devices and all input rates. For example, it might be that your audio driver does not support recording with low quality. So Microsoft.Speech might not accept your audio device.

You need to use System.Speech API instead, it is designed for desktop API and should work.

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87