PowerShell-for-Hackers icon indicating copy to clipboard operation
PowerShell-for-Hackers copied to clipboard

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

Open Windos opened this issue 2 years ago • 0 comments

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

Windos avatar Apr 21 '23 05:04 Windos