From: Giovanni Mascellani gmascellani@codeweavers.com
Initializing the audio client without AUTOCONVERTPCM is expected to fail when the requested sampling rate or channel count does not match the mixing format. Such behavior is not currently modeled on Wine, but it should be introduced, and since here we expect automatic format conversion to work we add the flag. --- dlls/windows.media.speech/recognizer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c index 5c83beec063..1b365f0f39d 100644 --- a/dlls/windows.media.speech/recognizer.c +++ b/dlls/windows.media.speech/recognizer.c @@ -1071,7 +1071,8 @@ static HRESULT recognizer_factory_create_audio_capture(struct session *session) wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; TRACE("wfx tag %u, channels %u, samples %lu, bits %u, align %u.\n", wfx.wFormatTag, wfx.nChannels, wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nBlockAlign);
- if (FAILED(hr = IAudioClient_Initialize(session->audio_client, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK, buffer_duration, 0, &wfx, NULL))) + if (FAILED(hr = IAudioClient_Initialize(session->audio_client, AUDCLNT_SHAREMODE_SHARED, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM, buffer_duration, 0, &wfx, NULL))) goto cleanup;
if (FAILED(hr = IAudioClient_SetEventHandle(session->audio_client, session->audio_buf_event)))