-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make various changes to the SAPI 5 engine backend and test suites #58
Conversation
- Add test suite for Sapi5InProcEngine. - Add tests for recognition observers in test_engine_sapi5.py. - Change default engine class for SAPI5 to Sapi5InProcEngine. This is being done to work around a few problems with Sapi5SharedEngine, although that class can still be used. - Make SAPI 5's mimic method work synchronously by using code from ElementTester. - Make other minor changes to suites.py. - Remove engine-specific logic from ElementTester and RuleTestGrammar classes, assume engine.mimic() works properly for all engines. - Remove/workaround SAPI 5 recognition results limitation.
- Move TextTimerManager class into engines.base.timer as ThreadedTimerManager and adjust backend_text. - Stop requiring engine.connect() before using timers with the manager class. This is an unnecessary limitation. - Timeout thread.join() after 5 seconds to prevent the main thread hanging if timers are misused. - Use ThreadedTimerManager in SAPI 5 engine backend.
This is only necessary for the SAPI 5 in-process engine class.
- Add additional test method for dictation elements into SAPI 5 tests. - Change rule ID generation in SAPI 5 compiler to work with dictation elements and dragonfly lists. - Remove unused variables and imports in SAPI 5 engine file.
Both failing tests are fixed now. Everything passes using either engine class on Windows 7 and 10. I have also fixed an issue with dictation not working correctly and added a test for it in test_engine_sapi5.py. There were some intermittent test failures using the shared process engine. Issue #41 is still not resolved by these changes. I believe it to be an issue with WSR itself rather than dragonfly. Using the in-process engine instead should be good enough now. I think this is ready for merging. There should be a new release soon. |
Sounds good I'll try testing it out today! |
I'm having issues with Git, so go ahead and merge. We can always release a hot fix if there's something critical and Caster will need a few adjustments anyway to work. |
All right then, sounds good. Let me know if you need help with that :-) |
Re: #41, dictation-toolbox/Caster#305.
I've made various changes to the SAPI 5 engine backend and test suites:
I have all but two of the unit tests passing with both the in-process and shared process engine classes: the engine timer tests and a doctest for
RuleRef
elements. The test suites can be run with the following commands:Tests should be run with your microphone muted to prevent audio interfering with tests. There are some more instructions for testing the shared process class here.
The timer tests are easy to fix, however I'm not sure why the
RuleRef
test is failing. I excluded test_dictation.py because SAPI5 doesn't seem to handle accented characters.One other thing to note is that
RecognitionObservers
behave strangely with WSR. You should be fine as long as you don't rely on a set number of calls tonotify_begin()
ornotify_failure()
, they are sometimes called multiple times.@comodoro @LexiconCode Sorry I took a while to get to this, I wanted the test suites working properly beforehand. So far I've only tested on Windows 10, so if you're running an older version please let me know if more tests fail.