Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
62aec031
Commit
62aec031
authored
Feb 16, 2024
by
Shaun Ren
Committed by
Alexandre Julliard
Feb 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Implement ISpeechVoice::GetVoices.
parent
0f8b59a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
4 deletions
+48
-4
tts.c
dlls/sapi/tests/tts.c
+29
-2
tts.c
dlls/sapi/tts.c
+19
-2
No files found.
dlls/sapi/tests/tts.c
View file @
62aec031
...
...
@@ -416,7 +416,7 @@ static IClassFactory test_engine_cf = { &ClassFactoryVtbl };
static
void
test_spvoice
(
void
)
{
static
const
WCHAR
test_token_id
[]
=
L"HKEY_LOCAL_MACHINE
\\
Software
\\
Wine
\\
Winetest
\\
sapi
\\
tts
\\
TestEngin
e"
;
static
const
WCHAR
test_token_id
[]
=
L"HKEY_LOCAL_MACHINE
\\
Software
\\
Microsoft
\\
Speech
\\
Voices
\\
Tokens
\\
WinetestVoic
e"
;
static
const
WCHAR
test_text
[]
=
L"Hello! This is a test sentence."
;
ISpVoice
*
voice
;
...
...
@@ -432,6 +432,9 @@ static void test_spvoice(void)
DWORD
regid
;
DWORD
start
,
duration
;
ISpeechVoice
*
speech_voice
;
ISpeechObjectTokens
*
speech_tokens
;
LONG
count
;
BSTR
req
=
NULL
,
opt
=
NULL
;
HRESULT
hr
;
if
(
waveOutGetNumDevs
()
==
0
)
{
...
...
@@ -439,6 +442,8 @@ static void test_spvoice(void)
return
;
}
RegDeleteTreeA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Speech
\\
Voices
\\
WinetestVoice"
);
check_apttype
();
ok
(
test_apt_data
.
type
==
APTTYPE_UNITIALIZED
,
"got apt type %d.
\n
"
,
test_apt_data
.
type
);
...
...
@@ -588,6 +593,7 @@ static void test_spvoice(void)
hr
=
ISpObjectToken_CreateKey
(
token
,
L"Attributes"
,
&
attrs_key
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ISpDataKey_SetStringValue
(
attrs_key
,
L"Language"
,
L"409"
);
ISpDataKey_SetStringValue
(
attrs_key
,
L"Vendor"
,
L"Winetest"
);
ISpDataKey_Release
(
attrs_key
);
hr
=
ISpVoice_SetVoice
(
voice
,
token
);
...
...
@@ -685,6 +691,25 @@ static void test_spvoice(void)
hr
=
ISpVoice_QueryInterface
(
voice
,
&
IID_ISpeechVoice
,
(
void
**
)
&
speech_voice
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
count
=
-
1
;
hr
=
ISpeechVoice_GetVoices
(
speech_voice
,
NULL
,
NULL
,
&
speech_tokens
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
hr
=
ISpeechObjectTokens_get_Count
(
speech_tokens
,
&
count
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
count
>
0
,
"got %ld.
\n
"
,
count
);
ISpeechObjectTokens_Release
(
speech_tokens
);
req
=
SysAllocString
(
L"Vendor=Winetest"
);
opt
=
SysAllocString
(
L"Language=409;Gender=Male"
);
count
=
0xdeadbeef
;
hr
=
ISpeechVoice_GetVoices
(
speech_voice
,
req
,
opt
,
&
speech_tokens
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
hr
=
ISpeechObjectTokens_get_Count
(
speech_tokens
,
&
count
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
count
==
1
,
"got %ld.
\n
"
,
count
);
ISpeechObjectTokens_Release
(
speech_tokens
);
hr
=
ISpeechVoice_Speak
(
speech_voice
,
NULL
,
SVSFPurgeBeforeSpeak
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
...
...
@@ -695,8 +720,10 @@ done:
ISpVoice_Release
(
voice
);
ISpObjectToken_Release
(
token
);
ISpMMSysAudio_Release
(
audio_out
);
SysFreeString
(
req
);
SysFreeString
(
opt
);
RegDeleteTreeA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Winetest
\\
sapi"
);
RegDeleteTreeA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Speech
\\
Voices
\\
WinetestVoice"
);
}
START_TEST
(
tts
)
...
...
dlls/sapi/tts.c
View file @
62aec031
...
...
@@ -401,9 +401,26 @@ static HRESULT WINAPI speech_voice_Skip(ISpeechVoice *iface, const BSTR type, LO
static
HRESULT
WINAPI
speech_voice_GetVoices
(
ISpeechVoice
*
iface
,
BSTR
required
,
BSTR
optional
,
ISpeechObjectTokens
**
tokens
)
{
FIXME
(
"(%p, %s, %s, %p): stub.
\n
"
,
iface
,
debugstr_w
(
required
),
debugstr_w
(
optional
),
tokens
);
return
E_NOTIMPL
;
ISpObjectTokenCategory
*
cat
;
IEnumSpObjectTokens
*
token_enum
;
HRESULT
hr
;
TRACE
(
"(%p, %s, %s, %p).
\n
"
,
iface
,
debugstr_w
(
required
),
debugstr_w
(
optional
),
tokens
);
if
(
!
tokens
)
return
E_POINTER
;
if
(
FAILED
(
hr
=
create_token_category
(
SPCAT_VOICES
,
&
cat
)))
return
hr
;
if
(
SUCCEEDED
(
hr
=
ISpObjectTokenCategory_EnumTokens
(
cat
,
required
,
optional
,
&
token_enum
)))
{
hr
=
IEnumSpObjectTokens_QueryInterface
(
token_enum
,
&
IID_ISpeechObjectTokens
,
(
void
**
)
tokens
);
IEnumSpObjectTokens_Release
(
token_enum
);
}
ISpObjectTokenCategory_Release
(
cat
);
return
hr
;
}
static
HRESULT
WINAPI
speech_voice_GetAudioOutputs
(
ISpeechVoice
*
iface
,
BSTR
required
,
BSTR
optional
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment