Adjust approach to wait for speech (PR #14284)
Some calls to wait_for_speech_to_finish did not specify the speech index for speech
started (which usually should be nextSpeechIndex).
Generally, it is more concise to use _NvdaLib.getSpeechAfterKey rather than spy.emulateKeyPress,
wait_for_speech_to_finish and then get speech after index. getSpeechAfterKey handles
this all internally.
The speech spy synth driver simply called notify for all index commands, and added the speech
to an internal buffer, then called doneSpeaking.
This doesn't allow the core to process its queue.
This change:
- Checked all usages of wait_for_speech_to_finish and emulateKeyPress to see if getSpeechAfterKey
is more appropriate, or if nextSpeechIndex needs to be used.
- The speech spy synth driver now processes speech in a worker thread. Between each utterance,
the thread yields to allow core to process any queued callbacks.
Known issues:
- This change to increases the time required for tests from 15 min to ~22 min.