Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gabriel Ivăncescu
wine
Commits
5793c57c
Commit
5793c57c
authored
1 year ago
by
Shaun Ren
Committed by
Alexandre Julliard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
sapi: Implement ISpVoice::Set/GetRate.
parent
17635423
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/sapi/tests/tts.c
+30
-0
30 additions, 0 deletions
dlls/sapi/tests/tts.c
dlls/sapi/tts.c
+20
-6
20 additions, 6 deletions
dlls/sapi/tts.c
with
50 additions
and
6 deletions
dlls/sapi/tests/tts.c
+
30
−
0
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
);
}
...
...
This diff is collapsed.
Click to expand it.
dlls/sapi/tts.c
+
20
−
6
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment