Allow SAPI5 voices to be instantly interupted / paused by making use of the underlying ISPAudio interface. #8174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partly taken from #6166.
Link to issue number:
None
Summary of the issue:
Some SAPI5 voices, especially those from Microsoft included with Windows 8 and higher, feel as if they lag, due to the fact that interupting their last utterance does not work.
For instance, moving quickly though the synth settings ring causes these SAPI5 voices to read the entire current synth setting, rather than cutting off the end when new keyboard input is received. A more practical case would be quickly navigating up and down a document or left and right by character. In many cases the end of the line or character will be needlessly spoken.
Description of how this pull request fixes the issue:
Previously our SAPI5 synthDriver would instruct the SAPI5 engine to speak an empty string, interupting any previous speech and purging any remaining speech.
Now, we make use of the underlying ISPAudio interface to tell the audio to stop first, before we interupt and purge.
Similarly for pausing, we use ISPAudio to pause.
This allows us to instantainiously stop / pause with these newer SAPI5 voices.
Testing performed:
Tested various Microsoft voices on windows 10, noting that the lag has now disappeared.
Still requires testing on windows 7 and possibly 8. And also with some popular 3rd party SAPI5 voices.
Known issues with pull request:
None
Change log entry:
Bug fixes: