@@ -416,7 +416,7 @@ static IClassFactory test_engine_cf = { &ClassFactoryVtbl };
416
416
417
417
static void test_spvoice (void )
418
418
{
419
- static const WCHAR test_token_id [] = L"HKEY_LOCAL_MACHINE\\Software\\Wine\\Winetest\\sapi\\tts\\TestEngine " ;
419
+ static const WCHAR test_token_id [] = L"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Speech\\Voices\\Tokens\\WinetestVoice " ;
420
420
static const WCHAR test_text [] = L"Hello! This is a test sentence." ;
421
421
422
422
ISpVoice * voice ;
@@ -432,13 +432,18 @@ static void test_spvoice(void)
432
432
DWORD regid ;
433
433
DWORD start , duration ;
434
434
ISpeechVoice * speech_voice ;
435
+ ISpeechObjectTokens * speech_tokens ;
436
+ LONG count ;
437
+ BSTR req = NULL , opt = NULL ;
435
438
HRESULT hr ;
436
439
437
440
if (waveOutGetNumDevs () == 0 ) {
438
441
skip ("no wave out devices.\n" );
439
442
return ;
440
443
}
441
444
445
+ RegDeleteTreeA (HKEY_LOCAL_MACHINE , "Software\\Microsoft\\Speech\\Voices\\WinetestVoice" );
446
+
442
447
check_apttype ();
443
448
ok (test_apt_data .type == APTTYPE_UNITIALIZED , "got apt type %d.\n" , test_apt_data .type );
444
449
@@ -588,6 +593,7 @@ static void test_spvoice(void)
588
593
hr = ISpObjectToken_CreateKey (token , L"Attributes" , & attrs_key );
589
594
ok (hr == S_OK , "got %#lx.\n" , hr );
590
595
ISpDataKey_SetStringValue (attrs_key , L"Language" , L"409" );
596
+ ISpDataKey_SetStringValue (attrs_key , L"Vendor" , L"Winetest" );
591
597
ISpDataKey_Release (attrs_key );
592
598
593
599
hr = ISpVoice_SetVoice (voice , token );
@@ -685,6 +691,25 @@ static void test_spvoice(void)
685
691
hr = ISpVoice_QueryInterface (voice , & IID_ISpeechVoice , (void * * )& speech_voice );
686
692
ok (hr == S_OK , "got %#lx.\n" , hr );
687
693
694
+ count = -1 ;
695
+ hr = ISpeechVoice_GetVoices (speech_voice , NULL , NULL , & speech_tokens );
696
+ ok (hr == S_OK , "got %#lx.\n" , hr );
697
+ hr = ISpeechObjectTokens_get_Count (speech_tokens , & count );
698
+ ok (hr == S_OK , "got %#lx.\n" , hr );
699
+ ok (count > 0 , "got %ld.\n" , count );
700
+ ISpeechObjectTokens_Release (speech_tokens );
701
+
702
+ req = SysAllocString (L"Vendor=Winetest" );
703
+ opt = SysAllocString (L"Language=409;Gender=Male" );
704
+
705
+ count = 0xdeadbeef ;
706
+ hr = ISpeechVoice_GetVoices (speech_voice , req , opt , & speech_tokens );
707
+ ok (hr == S_OK , "got %#lx.\n" , hr );
708
+ hr = ISpeechObjectTokens_get_Count (speech_tokens , & count );
709
+ ok (hr == S_OK , "got %#lx.\n" , hr );
710
+ ok (count == 1 , "got %ld.\n" , count );
711
+ ISpeechObjectTokens_Release (speech_tokens );
712
+
688
713
hr = ISpeechVoice_Speak (speech_voice , NULL , SVSFPurgeBeforeSpeak , NULL );
689
714
ok (hr == S_OK , "got %#lx.\n" , hr );
690
715
@@ -695,8 +720,10 @@ static void test_spvoice(void)
695
720
ISpVoice_Release (voice );
696
721
ISpObjectToken_Release (token );
697
722
ISpMMSysAudio_Release (audio_out );
723
+ SysFreeString (req );
724
+ SysFreeString (opt );
698
725
699
- RegDeleteTreeA ( HKEY_LOCAL_MACHINE , "Software\\Wine\\Winetest\\sapi" );
726
+ RegDeleteTreeA (HKEY_LOCAL_MACHINE , "Software\\Microsoft\\Speech\\Voices\\WinetestVoice" );
700
727
}
701
728
702
729
START_TEST (tts )
0 commit comments