[PATCH 3/6] windows.media.speech/tests: Add basic tests for ssml/text to stream functions.

Cláudio Sampaio patola at gmail.com
Sat Jun 11 07:18:13 CDT 2022


Hi Bernard,

You have been doing windows.media.speech mainly due to Phasmophobia, right?
There was an update today:
https://steamcommunity.com/app/739630/eventcomments/3421060714389955228/

Specifically this excerpt:



Our Voice recognition system has been completely replaced!

We are no longer relying on Windows' speech systems, meaning it supports
many more languages and platforms, such as ‘GeForce Now’ and Steam Deck,
with no setup required (and fixes that pesky tab-out bug).


   - You now only need to set your microphone in-game, instead of your
   ‘Windows Default Microphone’
   - You can now see the input volume of your microphone in the Audio
   Settings
   - Additional microphone input options have been added:
   - Voice Detector Sensitivity
      - Noise Suppression

   - Due to the new system only working if you are in a server, the voice
   recognition test has been removed.

It seems that dknighter (the game main developer) did that for the Steam
Deck. I haven't yet tested on my Deck, but did not work on my Arch Linux
(maybe an early bug).

Does that harm your work? Or I'm wrong about Phasmophobia being the main
drive behind your massive work?

On Thu, Jun 9, 2022 at 6:48 PM Bernhard Kölbl <wine at gitlab.winehq.org>
wrote:

> From: Bernhard Kölbl <besentv at gmail.com>
>
> Signed-off-by: Bernhard Kölbl <besentv at gmail.com>
> ---
>  dlls/windows.media.speech/tests/speech.c | 80 ++++++++++++++++++++++--
>  1 file changed, 76 insertions(+), 4 deletions(-)
>
> diff --git a/dlls/windows.media.speech/tests/speech.c
> b/dlls/windows.media.speech/tests/speech.c
> index 7c870901de9..9df71e2b6cb 100644
> --- a/dlls/windows.media.speech/tests/speech.c
> +++ b/dlls/windows.media.speech/tests/speech.c
> @@ -779,18 +779,26 @@ static void test_ActivationFactory(void)
>
>  static void test_SpeechSynthesizer(void)
>  {
> +    static const WCHAR *simple_ssml =
> +    L"<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis'
> xml:lang='en-US'>"
> +         "Hello, how are you doing today?"
> +     "</speak>";
> +    static const WCHAR *simple_synth_text = L"Hello, how are you doing
> today?";
>      static const WCHAR *speech_synthesizer_name =
> L"Windows.Media.SpeechSynthesis.SpeechSynthesizer";
>      static const WCHAR *speech_synthesizer_name2 =
> L"windows.media.speechsynthesis.speechsynthesizer";
>      static const WCHAR *unknown_class_name = L"Unknown.Class";
>      IActivationFactory *factory = NULL, *factory2 = NULL;
> +    IAsyncOperation_SpeechSynthesisStream *operation_ss_stream = NULL;
>      IVectorView_VoiceInformation *voices = NULL;
>      IInstalledVoicesStatic *voices_static = NULL;
> +    ISpeechSynthesisStream *ss_stream = NULL;
>      IVoiceInformation *voice;
>      IInspectable *inspectable = NULL, *tmp_inspectable = NULL;
>      IAgileObject *agile_object = NULL, *tmp_agile_object = NULL;
>      ISpeechSynthesizer *synthesizer;
>      ISpeechSynthesizer2 *synthesizer2;
>      IClosable *closable;
> +    struct async_inspectable_handler async_inspectable_handler;
>      HMODULE hdll;
>      HSTRING str, str2;
>      HRESULT hr;
> @@ -843,6 +851,7 @@ static void test_SpeechSynthesizer(void)
>          FreeLibrary(hdll);
>      }
>
> +    /* Test static Synth ifaces: IActivationFactory,
> IInstalledVoicesStatic, etc. */
>      hr = IActivationFactory_QueryInterface(factory, &IID_IInspectable,
> (void **)&inspectable);
>      ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable
> failed, hr %#lx\n", hr);
>
> @@ -889,11 +898,24 @@ static void test_SpeechSynthesizer(void)
>
>      IVectorView_VoiceInformation_Release(voices);
>
> -    IInstalledVoicesStatic_Release(voices_static);
> +    hr = IInstalledVoicesStatic_get_DefaultVoice(voices_static, &voice);
> +    todo_wine ok(hr == S_OK, "IInstalledVoicesStatic_get_DefaultVoice
> failed, hr %#lx\n", hr);
> +
> +    if (hr == S_OK)
> +    {
> +        IVoiceInformation_get_Description(voice, &str2);
> +        trace("SpeechSynthesizer default voice %s.\n",
> debugstr_hstring(str2));
> +
> +        WindowsDeleteString(str2);
> +        ref = IVoiceInformation_Release(voice);
> +        ok(ref == 0, "Got unexpected ref %lu.\n", ref);
> +    }
>
> +    IInstalledVoicesStatic_Release(voices_static);
>      IAgileObject_Release(agile_object);
>      IInspectable_Release(inspectable);
>
> +    /* Test Synthesizer */
>      hr = IActivationFactory_QueryInterface(factory,
> &IID_ISpeechSynthesizer, (void **)&synthesizer);
>      ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
>
> @@ -903,13 +925,63 @@ static void test_SpeechSynthesizer(void)
>      hr = IInspectable_QueryInterface(inspectable,
> &IID_ISpeechSynthesizer, (void **)&synthesizer);
>      ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
>
> +    /* Test SynthesizeTextToStreamAsync */
> +    hr = WindowsCreateString(simple_synth_text,
> wcslen(simple_synth_text), &str);
> +    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;
> +
> +    await_async_inspectable((IAsyncOperation_IInspectable
> *)operation_ss_stream,
> +                             &async_inspectable_handler,
> +
>  &IID_IAsyncOperationCompletedHandler_SpeechSynthesisStream);
> +    check_async_info((IInspectable *)operation_ss_stream, 1, Completed,
> S_OK);
> +    check_interface(operation_ss_stream, &IID_IAgileObject, TRUE);
> +
> +    hr =
> IAsyncOperation_SpeechSynthesisStream_GetResults(operation_ss_stream,
> &ss_stream);
> +    todo_wine ok(hr == S_OK,
> "IAsyncOperation_SpeechSynthesisStream_GetResults failed, hr %#lx\n", hr);
> +
> +    if (hr == S_OK && ss_stream)
> +    {
> +        ref = ISpeechSynthesisStream_Release(ss_stream);
> +        todo_wine ok(ref == 0, "Got unexpected ref %lu.\n", ref);
> +    }
> +
> +    IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
> +    WindowsDeleteString(str);
> +
> +    /* Test SynthesizeSsmlToStreamAsync */
> +    hr = WindowsCreateString(simple_ssml, wcslen(simple_ssml), &str);
> +    ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
> +
> +    hr = ISpeechSynthesizer_SynthesizeSsmlToStreamAsync(synthesizer, str,
> &operation_ss_stream);
> +    todo_wine 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);
> +    check_async_info((IInspectable *)operation_ss_stream, 2, Completed,
> S_OK);
> +    check_interface(operation_ss_stream, &IID_IAgileObject, TRUE);
> +
> +    hr =
> IAsyncOperation_SpeechSynthesisStream_GetResults(operation_ss_stream,
> &ss_stream);
> +    todo_wine ok(hr == S_OK,
> "IAsyncOperation_SpeechSynthesisStream_GetResults failed, hr %#lx\n", hr);
> +
> +    if (hr == S_OK && ss_stream)
> +    {
> +        ref = ISpeechSynthesisStream_Release(ss_stream);
> +        ok(ref == 0, "Got unexpected ref %lu.\n", ref);
> +    }
> +
> +    IAsyncOperation_SpeechSynthesisStream_Release(operation_ss_stream);
> +
> +skip_ss_stream:
> +    WindowsDeleteString(str);
> +
>      hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void
> **)&closable);
>      ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
>
>      hr = IInspectable_QueryInterface(inspectable,
> &IID_ISpeechSynthesizer2, (void **)&synthesizer2);
> -    ok(hr == S_OK ||
> -            broken(hr == E_NOINTERFACE), /* requires newer Windows */
> -            "Got unexpected hr %#lx.\n", hr);
> +    ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Got unexpected hr
> %#lx.\n", hr); /* Requires Win10 >= 1703 */
>
>      if (hr == S_OK)
>      {
> --
> GitLab
>
>
> https://gitlab.winehq.org/wine/wine/-/merge_requests/217
>
>

-- 
Cláudio "Patola" Sampaio
Wrocław, Polska
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220611/85ab5ea4/attachment.htm>


More information about the wine-devel mailing list