Commit f184c777 authored by Bernhard Kölbl's avatar Bernhard Kölbl Committed by Alexandre Julliard

windows.media.speech: Return IAsyncOperation from synthesizer_SynthesizeSsmlToStreamAsync.

Based on a patch by Connor McAdams <cmcadams@codeweavers.com> Signed-off-by: 's avatarBernhard Kölbl <besentv@gmail.com>
parent d8637c9b
...@@ -254,11 +254,17 @@ static HRESULT WINAPI synthesizer_SynthesizeTextToStreamAsync( ISpeechSynthesize ...@@ -254,11 +254,17 @@ static HRESULT WINAPI synthesizer_SynthesizeTextToStreamAsync( ISpeechSynthesize
text_to_stream_operation, (IAsyncOperation_IInspectable **)operation); text_to_stream_operation, (IAsyncOperation_IInspectable **)operation);
} }
static HRESULT CALLBACK ssml_to_stream_operation( IInspectable *invoker, IInspectable **result )
{
return S_OK;
}
static HRESULT WINAPI synthesizer_SynthesizeSsmlToStreamAsync( ISpeechSynthesizer *iface, HSTRING ssml, static HRESULT WINAPI synthesizer_SynthesizeSsmlToStreamAsync( ISpeechSynthesizer *iface, HSTRING ssml,
IAsyncOperation_SpeechSynthesisStream **operation ) IAsyncOperation_SpeechSynthesisStream **operation )
{ {
FIXME("iface %p, text %p, operation %p stub.\n", iface, ssml, operation); FIXME("iface %p, text %p, operation %p stub.\n", iface, ssml, operation);
return E_NOTIMPL; return async_operation_inspectable_create(&IID_IAsyncOperation_SpeechSynthesisStream, NULL,
ssml_to_stream_operation, (IAsyncOperation_IInspectable **)operation);
} }
static HRESULT WINAPI synthesizer_put_Voice( ISpeechSynthesizer *iface, IVoiceInformation *value ) static HRESULT WINAPI synthesizer_put_Voice( ISpeechSynthesizer *iface, IVoiceInformation *value )
......
...@@ -971,8 +971,7 @@ static void test_SpeechSynthesizer(void) ...@@ -971,8 +971,7 @@ static void test_SpeechSynthesizer(void)
ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr); ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str2, &operation_ss_stream); hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str2, &operation_ss_stream);
todo_wine ok(hr == S_OK, "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); 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, await_async_inspectable((IAsyncOperation_IInspectable *)operation_ss_stream,
&async_inspectable_handler, &async_inspectable_handler,
...@@ -998,28 +997,27 @@ static void test_SpeechSynthesizer(void) ...@@ -998,28 +997,27 @@ static void test_SpeechSynthesizer(void)
operation_ss_stream = (void *)0xdeadbeef; operation_ss_stream = (void *)0xdeadbeef;
hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, NULL, &operation_ss_stream); hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, NULL, &operation_ss_stream);
/* Broken on Win 8 + 8.1 */ /* Broken on Win 8 + 8.1 */
todo_wine ok(hr == S_OK || broken(hr == E_INVALIDARG), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); ok(hr == S_OK || broken(hr == E_INVALIDARG), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
if (hr == S_OK) if (hr == S_OK)
{ {
todo_wine ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream); ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream);
IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream); IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
} }
else todo_wine ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream); else ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream);
operation_ss_stream = (void *)0xdeadbeef; operation_ss_stream = (void *)0xdeadbeef;
hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str, &operation_ss_stream); hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str, &operation_ss_stream);
/* Broken on Win 8 + 8.1 */ /* Broken on Win 8 + 8.1 */
todo_wine ok(hr == S_OK || broken(hr == SPERR_WINRT_INCORRECT_FORMAT), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr); ok(hr == S_OK || broken(hr == SPERR_WINRT_INCORRECT_FORMAT), "ISpeechSynthesizer_SynthesizeSsmlToStreamAsync failed, hr %#lx\n", hr);
if (hr == S_OK) if (hr == S_OK)
{ {
todo_wine ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream); ok(!!operation_ss_stream, "operation_ss_stream had value %p.\n", operation_ss_stream);
IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream); IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
} }
else todo_wine ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream); else ok(operation_ss_stream == NULL, "operation_ss_stream had value %p.\n", operation_ss_stream);
skip_ss_stream:
WindowsDeleteString(str2); WindowsDeleteString(str2);
WindowsDeleteString(str); WindowsDeleteString(str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment