From: Bernhard Kölbl besentv@gmail.com
Based on a patch by: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- dlls/windows.media.speech/synthesizer.c | 8 +++++++- dlls/windows.media.speech/tests/speech.c | 11 +++++------ 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c index e8c9f0a280d..3a77fc62234 100644 --- a/dlls/windows.media.speech/synthesizer.c +++ b/dlls/windows.media.speech/synthesizer.c @@ -241,11 +241,17 @@ static HRESULT WINAPI synthesizer_GetTrustLevel( ISpeechSynthesizer *iface, Trus return E_NOTIMPL; }
+static HRESULT CALLBACK text_to_stream_operation( IInspectable *invoker, IInspectable **result ) +{ + return S_OK; +} + static HRESULT WINAPI synthesizer_SynthesizeTextToStreamAsync( ISpeechSynthesizer *iface, HSTRING text, IAsyncOperation_SpeechSynthesisStream **operation ) { FIXME("iface %p, text %p, operation %p stub.\n", iface, text, operation); - return E_NOTIMPL; + return async_operation_inspectable_create(&IID_IAsyncOperation_SpeechSynthesisStream, NULL, + text_to_stream_operation, (IAsyncOperation_IInspectable **)operation); }
static HRESULT WINAPI synthesizer_SynthesizeSsmlToStreamAsync( ISpeechSynthesizer *iface, HSTRING ssml, diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index ef43eb77317..df5341d3142 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -933,13 +933,11 @@ static void test_SpeechSynthesizer(void) ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = ISpeechSynthesizer_SynthesizeTextToStreamAsync(synthesizer, NULL, &operation_ss_stream); - todo_wine ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeTextToStreamAsync failed, hr %#lx\n", hr); - if(FAILED(hr)) goto skip_ss_stream; - + ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeTextToStreamAsync failed, hr %#lx\n", hr); IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
hr = ISpeechSynthesizer_SynthesizeTextToStreamAsync(synthesizer, str, &operation_ss_stream); - todo_wine ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeTextToStreamAsync failed, hr %#lx\n", hr); + ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeTextToStreamAsync failed, hr %#lx\n", hr);
await_async_inspectable((IAsyncOperation_IInspectable *)operation_ss_stream, &async_inspectable_handler, @@ -974,6 +972,8 @@ static void test_SpeechSynthesizer(void)
hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str2, &operation_ss_stream); todo_wine ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); + if(FAILED(hr)) goto skip_ss_stream; + await_async_inspectable((IAsyncOperation_IInspectable *)operation_ss_stream, &async_inspectable_handler, &IID_IAsyncOperationCompletedHandler_SpeechSynthesisStream); @@ -1019,9 +1019,8 @@ static void test_SpeechSynthesizer(void) } else todo_wine ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream);
- WindowsDeleteString(str2); - skip_ss_stream: + WindowsDeleteString(str2); WindowsDeleteString(str);
hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void **)&closable);