title: Windows Speech Recognition Hello World not working
body: <p>I am trying to get <code>Windows::Media::SpeechRecognition</code> working on Windows10 but I have trouble making my Hello World App working.</p>
  
  <p>Here is what I did:</p>
  
  <ul>
  <li><p>I created a new UWP Blank App in VS2017</p></li>
  <li><p>In the <code>OnLaunched()</code> method, I call my <code>Init()</code> method to initialize Speech Recognition:</p>
  
  <pre><code>void App::Init()
  {
      speechRecognizer = ref new Windows::Media::SpeechRecognition::SpeechRecognizer(Windows::Media::SpeechRecognition::SpeechRecognizer::SystemSpeechLanguage);
  
      Platform::Collections::Vector&lt;String^&gt;^ speech_command_list = ref new Platform::Collections::Vector&lt;String^&gt;();
      speech_command_list-&gt;Append(StringReference(L"pause"));
      speech_command_list-&gt;Append(StringReference(L"play"));
      speech_command_list-&gt;Append(StringReference(L"download"));
      speech_command_list-&gt;Append(StringReference(L"test"));
  
      SpeechRecognitionListConstraint^ speech_constraint = ref new SpeechRecognitionListConstraint(speech_command_list);
  
      speechRecognizer-&gt;Constraints-&gt;Append(speech_constraint);
  
      create_task(speechRecognizer-&gt;CompileConstraintsAsync()).then([this](SpeechRecognitionCompilationResult^ compilationResult)
      {
          if (compilationResult-&gt;Status == SpeechRecognitionResultStatus::Success)
          {
  
              speechRecognizer-&gt;ContinuousRecognitionSession-&gt;ResultGenerated += ref new TypedEventHandler&lt;SpeechContinuousRecognitionSession^, SpeechContinuousRecognitionResultGeneratedEventArgs^&gt;(this, &amp;App::OnSpeechRecognized);
              speechRecognizer-&gt;HypothesisGenerated += ref new TypedEventHandler&lt;Windows::Media::SpeechRecognition::SpeechRecognizer^, SpeechRecognitionHypothesisGeneratedEventArgs^&gt;(this, &amp;App::OnHypothesisGenerated);
              speechRecognizer-&gt;StateChanged += ref new TypedEventHandler&lt;Windows::Media::SpeechRecognition::SpeechRecognizer^, SpeechRecognizerStateChangedEventArgs^&gt;(this, &amp;App::OnStateChanged);
              speechRecognizer-&gt;RecognitionQualityDegrading += ref new TypedEventHandler&lt;Windows::Media::SpeechRecognition::SpeechRecognizer^, SpeechRecognitionQualityDegradingEventArgs^&gt;(this, &amp;App::OnQualityIssue);
  
              TimeSpan endSilenceTime;
              endSilenceTime.Duration = 12000000L;
              speechRecognizer-&gt;Timeouts-&gt;EndSilenceTimeout = endSilenceTime; // (1.2 seconds in nanoseconds)
  
              speechRecognizer-&gt;ContinuousRecognitionSession-&gt;StartAsync();
          }
          else
          {
              // Handle errors here.
          }
      });
  }
  </code></pre></li>
  <li><p>The code compiles, and launches, the compilation of speech constraints is successful, and I break once in the callback <code>OnStateChanged</code> with a new state value as <code>Idle</code></p></li>
  </ul>
  
  <p>And that's it. I do not receive any more callbacks when speaking into my mic.</p>
  
  <p>For the record, my mic is properly plugged, it is the default mic on Windows, and it is functional.</p>