Jinoh Kang (@iamahuman) commented about dlls/windows.media.speech/recognizer.c:
- return hr;
}
static HRESULT WINAPI session_Resume( ISpeechContinuousRecognitionSession *iface ) {
- FIXME("iface %p stub!\n", iface);
- return E_NOTIMPL;
- struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface);
- TRACE("iface %p.\n", iface);
- EnterCriticalSection(&impl->cs);
- if (impl->worker_running)
- {
impl->worker_paused = FALSE;
impl->recognizer_state = SpeechRecognizerState_Idle;
From https://learn.microsoft.com/en-us/uwp/api/windows.media.speechrecognition.sp...:
**Idle**: 0
Indicates that speech recognition is not active and the speech recognizer is not capturing (listening for) audio input.
In this state, [SpeechRecognizer.RecognizeAsync], [SpeechRecognizer.RecognizeWithUIAsync], **[SpeechContinuousRecognitionSession.StartAsync]**, or [SpeechRecognizer.CompileConstraintsAsync] can be called.
(emphasis mine)
A successful call to `StartAsync` requires that `worker_running` is true as a precondition. However, the `get_State` implementation returns `recognizer_state` as-is. Therefore, `worker_running && recognizer_state == SpeechRecognizerState_Idle` is an invalid state combination.
Something like the following would make more sense:
```suggestion:-0+0 impl->recognizer_state = SpeechRecognizerState_Capturing; ```
[SpeechRecognizer.RecognizeAsync]: https://learn.microsoft.com/en-us/uwp/api/windows.media.speechrecognition.sp... [SpeechRecognizer.RecognizeWithUIAsync]: https://learn.microsoft.com/en-us/uwp/api/windows.media.speechrecognition.sp... [SpeechContinuousRecognitionSession.StartAsync]: https://learn.microsoft.com/en-us/uwp/api/windows.media.speechrecognition.sp...) [SpeechRecognizer.CompileConstraintsAsync]: https://learn.microsoft.com/en-us/uwp/api/windows.media.speechrecognition.sp...