Skip to content
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

Fix exception thrown by, and suppress output from, the Speak function #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Windos
Copy link

@Windos Windos commented Apr 21, 2023

This PR stops the Speak function from throwing an exception when it tries to enumerate voices on the SAPI.SpVoice object before it has been created.

image

Further, the .Speak method used in this function outputs a number that's used in apps to associate queued async streams with events. As a user though... it means nothing and as the function doesn't set the async flag, it always returns 1 anyway.

image

Moves the creation of the `SAPI.SpVoice` object above selection of the voice, as there's currently an error thrown when running this function due to the object not yet existing.
The `Speak` method returns a number which is used when "speaking" asynchronously.
As a user, the number is meaningless and via this function it will always be `1`.
This assigns the output to `null` so that there is no output from the function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant