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
5793c57c
Commit
5793c57c
authored
Jun 21, 2023
by
Shaun Ren
Committed by
Alexandre Julliard
Jun 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Implement ISpVoice::Set/GetRate.
parent
17635423
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
6 deletions
+50
-6
tts.c
dlls/sapi/tests/tts.c
+30
-0
tts.c
dlls/sapi/tts.c
+20
-6
No files found.
dlls/sapi/tests/tts.c
View file @
5793c57c
...
...
@@ -100,6 +100,7 @@ static void test_spvoice(void)
ISpObjectTokenCategory
*
token_cat
;
ISpObjectToken
*
token
;
WCHAR
*
token_id
=
NULL
,
*
default_token_id
=
NULL
;
LONG
rate
;
HRESULT
hr
;
if
(
waveOutGetNumDevs
()
==
0
)
{
...
...
@@ -149,6 +150,35 @@ static void test_spvoice(void)
ISpObjectTokenCategory_Release
(
token_cat
);
}
rate
=
0xdeadbeef
;
hr
=
ISpVoice_GetRate
(
voice
,
&
rate
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
rate
==
0
,
"rate = %ld
\n
"
,
rate
);
hr
=
ISpVoice_SetRate
(
voice
,
1
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
rate
=
0xdeadbeef
;
hr
=
ISpVoice_GetRate
(
voice
,
&
rate
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
rate
==
1
,
"rate = %ld
\n
"
,
rate
);
hr
=
ISpVoice_SetRate
(
voice
,
-
1000
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
rate
=
0xdeadbeef
;
hr
=
ISpVoice_GetRate
(
voice
,
&
rate
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
rate
==
-
1000
,
"rate = %ld
\n
"
,
rate
);
hr
=
ISpVoice_SetRate
(
voice
,
1000
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
rate
=
0xdeadbeef
;
hr
=
ISpVoice_GetRate
(
voice
,
&
rate
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
rate
==
1000
,
"rate = %ld
\n
"
,
rate
);
ISpVoice_Release
(
voice
);
ISpMMSysAudio_Release
(
audio_out
);
}
...
...
dlls/sapi/tts.c
View file @
5793c57c
...
...
@@ -43,6 +43,7 @@ struct speech_voice
ISpStreamFormat
*
output
;
ISpTTSEngine
*
engine
;
LONG
rate
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -750,18 +751,30 @@ static HRESULT WINAPI spvoice_GetAlertBoundary(ISpVoice *iface, SPEVENTENUM *bou
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
spvoice_SetRate
(
ISpVoice
*
iface
,
LONG
adjust
)
static
HRESULT
WINAPI
spvoice_SetRate
(
ISpVoice
*
iface
,
LONG
rate
)
{
FIXME
(
"(%p, %ld): stub.
\n
"
,
iface
,
adjust
);
struct
speech_voice
*
This
=
impl_from_ISpVoice
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"(%p, %ld).
\n
"
,
iface
,
rate
);
EnterCriticalSection
(
&
This
->
cs
);
This
->
rate
=
rate
;
LeaveCriticalSection
(
&
This
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
spvoice_GetRate
(
ISpVoice
*
iface
,
LONG
*
adjust
)
static
HRESULT
WINAPI
spvoice_GetRate
(
ISpVoice
*
iface
,
LONG
*
rate
)
{
FIXME
(
"(%p, %p): stub.
\n
"
,
iface
,
adjust
);
struct
speech_voice
*
This
=
impl_from_ISpVoice
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"(%p, %p).
\n
"
,
iface
,
rate
);
EnterCriticalSection
(
&
This
->
cs
);
*
rate
=
This
->
rate
;
LeaveCriticalSection
(
&
This
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
spvoice_SetVolume
(
ISpVoice
*
iface
,
USHORT
volume
)
...
...
@@ -930,6 +943,7 @@ HRESULT speech_voice_create(IUnknown *outer, REFIID iid, void **obj)
This
->
output
=
NULL
;
This
->
engine
=
NULL
;
This
->
rate
=
0
;
InitializeCriticalSection
(
&
This
->
cs
);
...
...
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