[PATCH v3 4/6] windows.media.speech: Return IAsyncOperation from synthesizer_SynthesizeTextToStreamAsync.

Bernhard Kölbl wine at gitlab.winehq.org
Thu Jun 9 14:20:47 CDT 2022


From: Bernhard Kölbl <besentv at gmail.com>

Based on a patch by: Connor McAdams <cmcadams at codeweavers.com>

Signed-off-by: Bernhard Kölbl <besentv at gmail.com>
---
 dlls/windows.media.speech/synthesizer.c  | 8 +++++++-
 dlls/windows.media.speech/tests/speech.c | 6 +++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/dlls/windows.media.speech/synthesizer.c b/dlls/windows.media.speech/synthesizer.c
index e8c9f0a280d..9275aa18c67 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;
+    async_operation_inspectable_create(&IID_ISpeechSynthesisStream, NULL, text_to_stream_operation, (IAsyncOperation_IInspectable **)operation);
+    return S_OK;
 }
 
 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 01543c145e3..8c584264fee 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -931,9 +931,7 @@ static void test_SpeechSynthesizer(void)
     ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
 
     hr = ISpeechSynthesizer_SynthesizeTextToStreamAsync(synthesizer, str, &operation_ss_stream);
-    todo_wine ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
-    if(FAILED(hr)) goto skip_ss_stream;
-
+    ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
     await_async_inspectable((IAsyncOperation_IInspectable *)operation_ss_stream,
                              &async_inspectable_handler,
                              &IID_IAsyncOperationCompletedHandler_SpeechSynthesisStream);
@@ -958,6 +956,8 @@ static void test_SpeechSynthesizer(void)
 
     hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str, &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);
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/217



More information about the wine-devel mailing list