From: Bernhard K��lbl besentv@gmail.com
--- dlls/windows.media.speech/tests/speech.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 0d67c8b7cdb..7429e0822d4 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -1777,8 +1777,7 @@ skip_action: hr = ISpeechContinuousRecognitionSession_remove_ResultGenerated(session, token); ok(hr == S_OK, "ISpeechContinuousRecognitionSession_remove_ResultGenerated failed, hr %#lx.\n", hr);
- ref = ISpeechContinuousRecognitionSession_Release(session); - ok(ref == 1, "Got unexpected ref %lu.\n", ref); + ISpeechContinuousRecognitionSession_Release(session);
ref = ISpeechRecognizer2_Release(recognizer2); ok(ref == 2, "Got unexpected ref %lu.\n", ref);
From: Bernhard Kölbl besentv@gmail.com
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- dlls/windows.media.speech/async.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.media.speech/async.c b/dlls/windows.media.speech/async.c index 5d20fe482f1..9560350d2e4 100644 --- a/dlls/windows.media.speech/async.c +++ b/dlls/windows.media.speech/async.c @@ -93,6 +93,20 @@ ULONG WINAPI async_void_Release( IAsyncAction *iface ) struct async_void *impl = impl_from_IAsyncAction(iface); ULONG ref = InterlockedDecrement(&impl->ref); TRACE("iface %p, ref %lu.\n", iface, ref); + + if (!ref) + { + IAsyncInfo_Close(&impl->IAsyncInfo_iface); + + if (impl->invoker) + IInspectable_Release(impl->invoker); + if (impl->handler && impl->handler != HANDLER_NOT_SET) + IAsyncActionCompletedHandler_Release(impl->handler); + + DeleteCriticalSection(&impl->cs); + free(impl); + } + return ref; }
@@ -127,7 +141,7 @@ HRESULT WINAPI async_void_put_Completed( IAsyncAction *iface, IAsyncActionComple else if (impl->handler != HANDLER_NOT_SET) hr = E_ILLEGAL_DELEGATE_ASSIGNMENT; /* - impl->handler can only be set once with async_operation_put_Completed, + impl->handler can only be set once with async_void_put_Completed, so by default we set a non HANDLER_NOT_SET value, in this case handler. */ else if ((impl->handler = handler))
From: Bernhard K��lbl besentv@gmail.com
--- include/windows.media.speechsynthesis.idl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/include/windows.media.speechsynthesis.idl b/include/windows.media.speechsynthesis.idl index c4a0eb06106..4a79a9ec16f 100644 --- a/include/windows.media.speechsynthesis.idl +++ b/include/windows.media.speechsynthesis.idl @@ -27,6 +27,8 @@ import "windows.storage.streams.idl";
namespace Windows.Media.SpeechSynthesis { + typedef enum SpeechAppendedSilence SpeechAppendedSilence; + typedef enum SpeechPunctuationSilence SpeechPunctuationSilence; typedef enum VoiceGender VoiceGender; interface IInstalledVoicesStatic; interface IInstalledVoicesStatic2; @@ -48,6 +50,24 @@ namespace Windows.Media.SpeechSynthesis interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Media.SpeechSynthesis.SpeechSynthesisStream*>; }
+ [ + contract(Windows.Foundation.UniversalApiContract, 6.0) + ] + enum SpeechAppendedSilence + { + Default = 0, + Min = 1 + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0) + ] + enum SpeechPunctuationSilence + { + Default = 0, + Min = 1 + }; + [ contract(Windows.Foundation.UniversalApiContract, 1.0) ]
From: Bernhard K��lbl besentv@gmail.com
--- include/windows.media.speechsynthesis.idl | 37 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/include/windows.media.speechsynthesis.idl b/include/windows.media.speechsynthesis.idl index 4a79a9ec16f..5b44c018c9b 100644 --- a/include/windows.media.speechsynthesis.idl +++ b/include/windows.media.speechsynthesis.idl @@ -34,6 +34,9 @@ namespace Windows.Media.SpeechSynthesis interface IInstalledVoicesStatic2; interface ISpeechSynthesizer; interface ISpeechSynthesizer2; + interface ISpeechSynthesizerOptions; + interface ISpeechSynthesizerOptions2; + interface ISpeechSynthesizerOptions3; interface IVoiceInformation; interface ISpeechSynthesisStream; runtimeclass SpeechSynthesizer; @@ -132,7 +135,7 @@ namespace Windows.Media.SpeechSynthesis }
[ - contract(Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 4.0), exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizerOptions), uuid(a0e23871-cc3d-43c9-91b1-ee185324d83d) ] @@ -144,6 +147,34 @@ namespace Windows.Media.SpeechSynthesis [propput] HRESULT IncludeSentenceBoundaryMetadata([in] boolean value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 5.0), + exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizerOptions), + uuid(1cbef60e-119c-4bed-b118-d250c3a25793), + ] + interface ISpeechSynthesizerOptions2 : IInspectable + { + [propget] HRESULT AudioVolume([out, retval] DOUBLE *value); + [propput] HRESULT AudioVolume([in] DOUBLE value); + [propget] HRESULT SpeakingRate([out, retval] DOUBLE *value); + [propput] HRESULT SpeakingRate([in] DOUBLE value); + [propget] HRESULT AudioPitch([out, retval] DOUBLE *value); + [propput] HRESULT AudioPitch([in] DOUBLE value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizerOptions), + uuid(401ed877-902c-4814-a582-a5d0c0769fa8) + ] + interface ISpeechSynthesizerOptions3 : IInspectable + { + [propget] HRESULT AppendedSilence([out, retval] Windows.Media.SpeechSynthesis.SpeechAppendedSilence *value); + [propput] HRESULT AppendedSilence([in] Windows.Media.SpeechSynthesis.SpeechAppendedSilence value); + [propget] HRESULT PunctuationSilence([out, retval] Windows.Media.SpeechSynthesis.SpeechPunctuationSilence *value); + [propput] HRESULT PunctuationSilence([in] Windows.Media.SpeechSynthesis.SpeechPunctuationSilence value); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizer), @@ -165,12 +196,14 @@ namespace Windows.Media.SpeechSynthesis }
[ - contract(Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 4.0), marshaling_behavior(agile) ] runtimeclass SpeechSynthesizerOptions { [default] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions; + [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions2; + [contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions3; }
[
From: Bernhard K��lbl besentv@gmail.com
--- include/windows.media.speechsynthesis.idl | 84 +++++++++++------------ 1 file changed, 42 insertions(+), 42 deletions(-)
diff --git a/include/windows.media.speechsynthesis.idl b/include/windows.media.speechsynthesis.idl index 5b44c018c9b..a9c5f4f2c08 100644 --- a/include/windows.media.speechsynthesis.idl +++ b/include/windows.media.speechsynthesis.idl @@ -32,17 +32,17 @@ namespace Windows.Media.SpeechSynthesis typedef enum VoiceGender VoiceGender; interface IInstalledVoicesStatic; interface IInstalledVoicesStatic2; + interface ISpeechSynthesisStream; interface ISpeechSynthesizer; interface ISpeechSynthesizer2; interface ISpeechSynthesizerOptions; interface ISpeechSynthesizerOptions2; interface ISpeechSynthesizerOptions3; interface IVoiceInformation; - interface ISpeechSynthesisStream; + runtimeclass SpeechSynthesisStream; runtimeclass SpeechSynthesizer; - runtimeclass VoiceInformation; runtimeclass SpeechSynthesizerOptions; - runtimeclass SpeechSynthesisStream; + runtimeclass VoiceInformation;
declare { @@ -80,6 +80,17 @@ namespace Windows.Media.SpeechSynthesis Female = 1 };
+ [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizer), + uuid(7d526ecc-7533-4c3f-85be-888c2baeebdc) + ] + interface IInstalledVoicesStatic : IInspectable + { + [propget] HRESULT AllVoices([out, retval] Windows.Foundation.Collections.IVectorView<VoiceInformation*> **value); + [propget] HRESULT DefaultVoice([out, retval] VoiceInformation **value); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesisStream), @@ -120,20 +131,6 @@ namespace Windows.Media.SpeechSynthesis [propget] HRESULT Options([out, retval] SpeechSynthesizerOptions **value); }
- [ - contract(Windows.Foundation.UniversalApiContract, 1.0), - exclusiveto(Windows.Media.SpeechSynthesis.VoiceInformation), - uuid(b127d6a4-1291-4604-aa9c-83134083352c) - ] - interface IVoiceInformation : IInspectable - { - [propget] HRESULT DisplayName([out, retval] HSTRING *value); - [propget] HRESULT Id([out, retval] HSTRING *value); - [propget] HRESULT Language([out, retval] HSTRING *value); - [propget] HRESULT Description([out, retval] HSTRING *value); - [propget] HRESULT Gender([out, retval] VoiceGender *value); - } - [ contract(Windows.Foundation.UniversalApiContract, 4.0), exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizerOptions), @@ -177,33 +174,16 @@ namespace Windows.Media.SpeechSynthesis
[ contract(Windows.Foundation.UniversalApiContract, 1.0), - exclusiveto(Windows.Media.SpeechSynthesis.SpeechSynthesizer), - uuid(7d526ecc-7533-4c3f-85be-888c2baeebdc) - ] - interface IInstalledVoicesStatic : IInspectable - { - [propget] HRESULT AllVoices([out, retval] Windows.Foundation.Collections.IVectorView<VoiceInformation*> **value); - [propget] HRESULT DefaultVoice([out, retval] VoiceInformation **value); - } - - [ - contract(Windows.Foundation.UniversalApiContract, 1.0), - marshaling_behavior(agile) - ] - runtimeclass VoiceInformation - { - [default] interface Windows.Media.SpeechSynthesis.IVoiceInformation; - } - - [ - contract(Windows.Foundation.UniversalApiContract, 4.0), - marshaling_behavior(agile) + exclusiveto(Windows.Media.SpeechSynthesis.VoiceInformation), + uuid(b127d6a4-1291-4604-aa9c-83134083352c) ] - runtimeclass SpeechSynthesizerOptions + interface IVoiceInformation : IInspectable { - [default] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions; - [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions2; - [contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions3; + [propget] HRESULT DisplayName([out, retval] HSTRING *value); + [propget] HRESULT Id([out, retval] HSTRING *value); + [propget] HRESULT Language([out, retval] HSTRING *value); + [propget] HRESULT Description([out, retval] HSTRING *value); + [propget] HRESULT Gender([out, retval] VoiceGender *value); }
[ @@ -234,4 +214,24 @@ namespace Windows.Media.SpeechSynthesis interface Windows.Foundation.IClosable; [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizer2; } + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + marshaling_behavior(agile) + ] + runtimeclass SpeechSynthesizerOptions + { + [default] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions; + [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions2; + [contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Media.SpeechSynthesis.ISpeechSynthesizerOptions3; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass VoiceInformation + { + [default] interface Windows.Media.SpeechSynthesis.IVoiceInformation; + } }
From: Bernhard K��lbl besentv@gmail.com
--- dlls/windows.media.speech/tests/speech.c | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 7429e0822d4..cc4a4e2e472 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -1017,11 +1017,44 @@ static void test_SpeechSynthesizer(void) hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void **)&closable); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
+ /* Test ISpeechSynthesizer2 iface */ hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechSynthesizer2, (void **)&synthesizer2); ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr %#lx.\n", hr); /* Requires Win10 >= 1703 */
if (hr == S_OK) { + ISpeechSynthesizerOptions *options; + + hr = ISpeechSynthesizer2_get_Options(synthesizer2, &options); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + if (hr == S_OK) + { + ISpeechSynthesizerOptions2 *options2; + ISpeechSynthesizerOptions3 *options3; + + hr = ISpeechSynthesizerOptions_QueryInterface(options, &IID_ISpeechSynthesizerOptions2, (void **)&options2); + ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr %#lx.\n", hr); /* Requires Win10 >= 1709 */ + + if (hr == S_OK) + { + ref = ISpeechSynthesizerOptions2_Release(options2); + ok(ref == 2, "Got unexpected ref %lu.\n", ref); + } + + hr = ISpeechSynthesizerOptions_QueryInterface(options, &IID_ISpeechSynthesizerOptions3, (void **)&options3); + ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr %#lx.\n", hr); /* Requires Win10 >= 1803 */ + + if (hr == S_OK) + { + ref = ISpeechSynthesizerOptions3_Release(options3); + ok(ref == 2, "Got unexpected ref %lu.\n", ref); + } + + ref = ISpeechSynthesizerOptions_Release(options); + ok(ref == 1, "Got unexpected ref %lu.\n", ref); + } + ref = ISpeechSynthesizer2_Release(synthesizer2); ok(ref == 3, "Got unexpected ref %lu.\n", ref); }
From: Bernhard K��lbl besentv@gmail.com
--- dlls/windows.media.speech/tests/speech.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index cc4a4e2e472..45d774fdb12 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -59,6 +59,7 @@
HRESULT WINAPI (*pDllGetActivationFactory)(HSTRING, IActivationFactory **); static BOOL is_win10_1507 = FALSE; +static BOOL is_win10_1709 = FALSE;
static inline LONG get_ref(IUnknown *obj) { @@ -1050,6 +1051,8 @@ static void test_SpeechSynthesizer(void) ref = ISpeechSynthesizerOptions3_Release(options3); ok(ref == 2, "Got unexpected ref %lu.\n", ref); } + else + is_win10_1709 = TRUE;
ref = ISpeechSynthesizerOptions_Release(options); ok(ref == 1, "Got unexpected ref %lu.\n", ref); @@ -1483,10 +1486,14 @@ static void test_SpeechRecognitionListConstraint(void) hr = ISpeechRecognitionListConstraintFactory_CreateWithTag(listconstraint_factory, NULL, NULL, &listconstraint); ok(hr == E_POINTER, "ISpeechRecognitionListConstraintFactory_Create failed, hr %#lx.\n", hr);
- /* The create functions on Win10 1507 x32 break when handling the given iterator. Seems like a Windows bug. Skipping these tests. */ - if (broken(is_win10_1507 && (sizeof(void*) == 4))) + /* + * The create functions break on Win10 <= 1709 x32 with the given iterator. + * Seems like a Windows bug, but if you see an issue in the test's code, please FIXME. + * Skipping these tests. + */ + if (broken((is_win10_1507 || is_win10_1709) && (sizeof(void*) == 4))) { - win_skip("SpeechRecognitionListConstraint object creation broken on Win10 1507 x32!\n"); + win_skip("SpeechRecognitionListConstraint object creation broken on Win10 <= 1709 x32!\n"); goto skip_create; }
@@ -1634,10 +1641,14 @@ static void test_Recognition(void) ok(hr == S_OK, "WindowsCreateString failed, hr %#lx.\n", hr); }
- /* The create functions for ListConstraint are broken on Win10 1507 x32 - abort early.*/ - if (broken(is_win10_1507 && (sizeof(void*) == 4))) + /* + * The create functions break on Win10 <= 1709 x32 with the given iterator. + * Seems like a Windows bug, but if you see an issue in the test's code, please FIXME. + * Skipping these tests. + */ + if (broken((is_win10_1507 || is_win10_1709) && (sizeof(void*) == 4))) { - win_skip("SpeechRecognitionListConstraint object creation broken on Win10 1507 x32!\n"); + win_skip("SpeechRecognitionListConstraint object creation broken on Win10 <= 1709 x32!\n"); goto done; }