title: Access Denied HRESULT: 0x80070005 (E_ACCESSDENIED)) on SetInputToDefaultAudioDevice();
body: <p>I tried to programe some Speech Recognition app and I found this code:</p>
  
  <pre><code>SpeechRecognitionEngine recognitionEngine = new SpeechRecognitionEngine();
  
  recognitionEngine.SetInputToDefaultAudioDevice();    
  recognitionEngine.LoadGrammar(new DictationGrammar());    
  
  RecognitionResult result = recognitionEngine.Recognize(new TimeSpan(0, 0,20));    
  foreach (RecognizedWordUnit word in result.Words)     
  {     
       Console.Write(word.Text);     
  } 
  </code></pre>
  
  <p>But when I want to Debug it, it shows Error Access Denied  HRESULT: 0x80070005 (E_ACCESSDENIED)) on command : <strong>recognitionEngine.SetInputToDefaultAudioDevice();</strong></p>
  
  <p>(The reference to System.Speech is set). I looked through many threads already, but I can't find an answer.
  Should I set somwhere the access to microphone or how can I solve this problem?</p>
  
  <p>Thanks for the answer ;)</p>