Rémi Bernon (@rbernon) commented about dlls/windows.media.speech/recognizer.c:
if (old_paused < paused)
{
IAudioClient_Stop(impl->audio_client);
TRACE("session worker paused.\n");
}
if (old_paused > paused)
{
IAudioClient_Start(impl->audio_client);
TRACE("session worker resumed.\n");
}
continue; }
if (status == 1) /* audio_buf_event signaled */
{
while (IAudioCaptureClient_GetBuffer(impl->capture_client, &audio_buf, &frames_available, &flags, NULL, NULL) == S_OK)
Do you really want a nested loop here, what if it never ends? It's what the audio event is supposed to signal right? So maybe just rely on the event being signaled each time you can call `IAudioCaptureClient_GetBuffer`?