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
74129bd8
Commit
74129bd8
authored
Jan 15, 2023
by
Bernhard Kölbl
Committed by
Alexandre Julliard
Jan 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.media.speech: Partially implement the speech recognizer state.
Signed-off-by:
Bernhard Kölbl
<
besentv@gmail.com
>
parent
85ce23a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
22 deletions
+39
-22
recognizer.c
dlls/windows.media.speech/recognizer.c
+19
-2
speech.c
dlls/windows.media.speech/tests/speech.c
+20
-20
No files found.
dlls/windows.media.speech/recognizer.c
View file @
74129bd8
...
...
@@ -162,6 +162,8 @@ struct session
IVector_ISpeechRecognitionConstraint
*
constraints
;
SpeechRecognizerState
recognizer_state
;
struct
list
completed_handlers
;
struct
list
result_handlers
;
...
...
@@ -379,6 +381,7 @@ static HRESULT WINAPI session_StartAsync( ISpeechContinuousRecognitionSession *i
else
{
impl
->
worker_running
=
TRUE
;
impl
->
recognizer_state
=
SpeechRecognizerState_Capturing
;
}
LeaveCriticalSection
(
&
impl
->
cs
);
...
...
@@ -422,6 +425,7 @@ static HRESULT WINAPI session_StopAsync( ISpeechContinuousRecognitionSession *if
impl
->
worker_thread
=
INVALID_HANDLE_VALUE
;
impl
->
worker_running
=
FALSE
;
impl
->
worker_paused
=
FALSE
;
impl
->
recognizer_state
=
SpeechRecognizerState_Idle
;
}
else
{
...
...
@@ -475,6 +479,7 @@ static HRESULT WINAPI session_PauseAsync( ISpeechContinuousRecognitionSession *i
if
(
impl
->
worker_running
)
{
impl
->
worker_paused
=
TRUE
;
impl
->
recognizer_state
=
SpeechRecognizerState_Paused
;
}
LeaveCriticalSection
(
&
impl
->
cs
);
...
...
@@ -493,6 +498,7 @@ static HRESULT WINAPI session_Resume( ISpeechContinuousRecognitionSession *iface
if
(
impl
->
worker_running
)
{
impl
->
worker_paused
=
FALSE
;
impl
->
recognizer_state
=
SpeechRecognizerState_Capturing
;
}
LeaveCriticalSection
(
&
impl
->
cs
);
...
...
@@ -816,8 +822,19 @@ static HRESULT WINAPI recognizer2_get_ContinuousRecognitionSession( ISpeechRecog
static
HRESULT
WINAPI
recognizer2_get_State
(
ISpeechRecognizer2
*
iface
,
SpeechRecognizerState
*
state
)
{
FIXME
(
"iface %p, state %p stub!
\n
"
,
iface
,
state
);
return
E_NOTIMPL
;
struct
recognizer
*
impl
=
impl_from_ISpeechRecognizer2
(
iface
);
struct
session
*
session
=
impl_from_ISpeechContinuousRecognitionSession
(
impl
->
session
);
FIXME
(
"iface %p, state %p not all states are supported, yet.
\n
"
,
iface
,
state
);
if
(
!
state
)
return
E_POINTER
;
EnterCriticalSection
(
&
session
->
cs
);
*
state
=
session
->
recognizer_state
;
LeaveCriticalSection
(
&
session
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
recognizer2_StopRecognitionAsync
(
ISpeechRecognizer2
*
iface
,
IAsyncAction
**
action
)
...
...
dlls/windows.media.speech/tests/speech.c
View file @
74129bd8
...
...
@@ -1721,8 +1721,8 @@ static void test_Recognition(void)
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
recog_state
==
SpeechRecognizerState_Idle
,
"recog_state was %u.
\n
"
,
recog_state
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
ok
(
recog_state
==
SpeechRecognizerState_Idle
,
"recog_state was %u.
\n
"
,
recog_state
);
hr
=
ISpeechRecognizer_CompileConstraintsAsync
(
recognizer
,
&
operation
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer_CompileConstraintsAsync failed, hr %#lx.
\n
"
,
hr
);
...
...
@@ -1771,8 +1771,8 @@ static void test_Recognition(void)
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
recog_state
==
SpeechRecognizerState_Capturing
,
"recog_state was %u.
\n
"
,
recog_state
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
ok
(
recog_state
==
SpeechRecognizerState_Capturing
,
"recog_state was %u.
\n
"
,
recog_state
);
/*
* TODO: Use a loopback device together with prerecorded audio files to test the recognizer's functionality.
...
...
@@ -1786,9 +1786,9 @@ static void test_Recognition(void)
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
recog_state
==
SpeechRecognizerState_Paused
||
broken
(
recog_state
==
SpeechRecognizerState_Capturing
)
/* Broken on Win10 1507 */
,
"recog_state was %u.
\n
"
,
recog_state
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
ok
(
recog_state
==
SpeechRecognizerState_Paused
||
broken
(
recog_state
==
SpeechRecognizerState_Capturing
)
/* Broken on Win10 1507 */
,
"recog_state was %u.
\n
"
,
recog_state
);
/* Check what happens if we try to pause again, when the session is already paused. */
hr
=
ISpeechContinuousRecognitionSession_PauseAsync
(
session
,
&
action2
);
...
...
@@ -1806,8 +1806,8 @@ static void test_Recognition(void)
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
recog_state
==
SpeechRecognizerState_Capturing
,
"recog_state was %u.
\n
"
,
recog_state
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
ok
(
recog_state
==
SpeechRecognizerState_Capturing
,
"recog_state was %u.
\n
"
,
recog_state
);
hr
=
ISpeechContinuousRecognitionSession_StopAsync
(
session
,
&
action2
);
ok
(
hr
==
S_OK
,
"ISpeechContinuousRecognitionSession_StopAsync failed, hr %#lx.
\n
"
,
hr
);
...
...
@@ -1858,8 +1858,8 @@ static void test_Recognition(void)
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
recog_state
==
SpeechRecognizerState_Idle
,
"recog_state was %u.
\n
"
,
recog_state
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
ok
(
recog_state
==
SpeechRecognizerState_Idle
,
"recog_state was %u.
\n
"
,
recog_state
);
/* Try stopping, when already stopped. */
hr
=
ISpeechContinuousRecognitionSession_StopAsync
(
session
,
&
action
);
...
...
@@ -1879,9 +1879,9 @@ static void test_Recognition(void)
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
recog_state
==
SpeechRecognizerState_Paused
||
broken
(
recog_state
==
SpeechRecognizerState_Capturing
)
/* Broken on Win10 1507 */
,
"recog_state was %u.
\n
"
,
recog_state
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
ok
(
recog_state
==
SpeechRecognizerState_Paused
||
broken
(
recog_state
==
SpeechRecognizerState_Capturing
)
/* Broken on Win10 1507 */
,
"recog_state was %u.
\n
"
,
recog_state
);
hr
=
ISpeechContinuousRecognitionSession_StopAsync
(
session
,
&
action
);
ok
(
hr
==
S_OK
,
"ISpeechContinuousRecognitionSession_PauseAsync failed, hr %#lx.
\n
"
,
hr
);
...
...
@@ -1890,8 +1890,8 @@ static void test_Recognition(void)
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
recog_state
==
SpeechRecognizerState_Idle
,
"recog_state was %u.
\n
"
,
recog_state
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
ok
(
recog_state
==
SpeechRecognizerState_Idle
,
"recog_state was %u.
\n
"
,
recog_state
);
hr
=
ISpeechContinuousRecognitionSession_StartAsync
(
session
,
&
action
);
ok
(
hr
==
S_OK
,
"ISpeechContinuousRecognitionSession_PauseAsync failed, hr %#lx.
\n
"
,
hr
);
...
...
@@ -1900,10 +1900,10 @@ static void test_Recognition(void)
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
recog_state
==
SpeechRecognizerState_Capturing
||
broken
(
recog_state
==
SpeechRecognizerState_Idle
)
/* Sometimes Windows is a little behind. */
,
"recog_state was %u.
\n
"
,
recog_state
);
ok
(
hr
==
S_OK
,
"ISpeechRecognizer2_get_State failed, hr %#lx.
\n
"
,
hr
);
ok
(
recog_state
==
SpeechRecognizerState_Capturing
||
broken
(
recog_state
==
SpeechRecognizerState_Idle
)
/* Sometimes Windows is a little behind. */
,
"recog_state was %u.
\n
"
,
recog_state
);
hr
=
ISpeechContinuousRecognitionSession_StopAsync
(
session
,
&
action
);
ok
(
hr
==
S_OK
,
"ISpeechContinuousRecognitionSession_PauseAsync failed, hr %#lx.
\n
"
,
hr
);
...
...
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