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
02081ed6
Commit
02081ed6
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/GetVolume.
parent
5793c57c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
4 deletions
+46
-4
tts.c
dlls/sapi/tests/tts.c
+25
-0
tts.c
dlls/sapi/tts.c
+21
-4
No files found.
dlls/sapi/tests/tts.c
View file @
02081ed6
...
@@ -101,6 +101,7 @@ static void test_spvoice(void)
...
@@ -101,6 +101,7 @@ static void test_spvoice(void)
ISpObjectToken
*
token
;
ISpObjectToken
*
token
;
WCHAR
*
token_id
=
NULL
,
*
default_token_id
=
NULL
;
WCHAR
*
token_id
=
NULL
,
*
default_token_id
=
NULL
;
LONG
rate
;
LONG
rate
;
USHORT
volume
;
HRESULT
hr
;
HRESULT
hr
;
if
(
waveOutGetNumDevs
()
==
0
)
{
if
(
waveOutGetNumDevs
()
==
0
)
{
...
@@ -179,6 +180,30 @@ static void test_spvoice(void)
...
@@ -179,6 +180,30 @@ static void test_spvoice(void)
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
rate
==
1000
,
"rate = %ld
\n
"
,
rate
);
ok
(
rate
==
1000
,
"rate = %ld
\n
"
,
rate
);
volume
=
0xbeef
;
hr
=
ISpVoice_GetVolume
(
voice
,
&
volume
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
volume
==
100
,
"volume = %d
\n
"
,
volume
);
hr
=
ISpVoice_SetVolume
(
voice
,
0
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
volume
=
0xbeef
;
hr
=
ISpVoice_GetVolume
(
voice
,
&
volume
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
volume
==
0
,
"volume = %d
\n
"
,
volume
);
hr
=
ISpVoice_SetVolume
(
voice
,
100
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
volume
=
0xbeef
;
hr
=
ISpVoice_GetVolume
(
voice
,
&
volume
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
ok
(
volume
==
100
,
"volume = %d
\n
"
,
volume
);
hr
=
ISpVoice_SetVolume
(
voice
,
101
);
ok
(
hr
==
E_INVALIDARG
,
"got %#lx.
\n
"
,
hr
);
ISpVoice_Release
(
voice
);
ISpVoice_Release
(
voice
);
ISpMMSysAudio_Release
(
audio_out
);
ISpMMSysAudio_Release
(
audio_out
);
}
}
...
...
dlls/sapi/tts.c
View file @
02081ed6
...
@@ -43,6 +43,7 @@ struct speech_voice
...
@@ -43,6 +43,7 @@ struct speech_voice
ISpStreamFormat
*
output
;
ISpStreamFormat
*
output
;
ISpTTSEngine
*
engine
;
ISpTTSEngine
*
engine
;
USHORT
volume
;
LONG
rate
;
LONG
rate
;
CRITICAL_SECTION
cs
;
CRITICAL_SECTION
cs
;
};
};
...
@@ -779,16 +780,31 @@ static HRESULT WINAPI spvoice_GetRate(ISpVoice *iface, LONG *rate)
...
@@ -779,16 +780,31 @@ static HRESULT WINAPI spvoice_GetRate(ISpVoice *iface, LONG *rate)
static
HRESULT
WINAPI
spvoice_SetVolume
(
ISpVoice
*
iface
,
USHORT
volume
)
static
HRESULT
WINAPI
spvoice_SetVolume
(
ISpVoice
*
iface
,
USHORT
volume
)
{
{
FIXME
(
"(%p, %d): stub.
\n
"
,
iface
,
volum
e
);
struct
speech_voice
*
This
=
impl_from_ISpVoice
(
ifac
e
);
return
E_NOTIMPL
;
TRACE
(
"(%p, %d).
\n
"
,
iface
,
volume
);
if
(
volume
>
100
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
This
->
cs
);
This
->
volume
=
volume
;
LeaveCriticalSection
(
&
This
->
cs
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
spvoice_GetVolume
(
ISpVoice
*
iface
,
USHORT
*
volume
)
static
HRESULT
WINAPI
spvoice_GetVolume
(
ISpVoice
*
iface
,
USHORT
*
volume
)
{
{
FIXME
(
"(%p, %p): stub.
\n
"
,
iface
,
volum
e
);
struct
speech_voice
*
This
=
impl_from_ISpVoice
(
ifac
e
);
return
E_NOTIMPL
;
TRACE
(
"(%p, %p).
\n
"
,
iface
,
volume
);
EnterCriticalSection
(
&
This
->
cs
);
*
volume
=
This
->
volume
;
LeaveCriticalSection
(
&
This
->
cs
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
spvoice_WaitUntilDone
(
ISpVoice
*
iface
,
ULONG
timeout
)
static
HRESULT
WINAPI
spvoice_WaitUntilDone
(
ISpVoice
*
iface
,
ULONG
timeout
)
...
@@ -943,6 +959,7 @@ HRESULT speech_voice_create(IUnknown *outer, REFIID iid, void **obj)
...
@@ -943,6 +959,7 @@ HRESULT speech_voice_create(IUnknown *outer, REFIID iid, void **obj)
This
->
output
=
NULL
;
This
->
output
=
NULL
;
This
->
engine
=
NULL
;
This
->
engine
=
NULL
;
This
->
volume
=
100
;
This
->
rate
=
0
;
This
->
rate
=
0
;
InitializeCriticalSection
(
&
This
->
cs
);
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