Fixes Traceback when setting Sapi.SpVoice.Voice property#1211
Closed
kdschlosser wants to merge 1 commit intomhammond:masterfrom
Closed
Fixes Traceback when setting Sapi.SpVoice.Voice property#1211kdschlosser wants to merge 1 commit intomhammond:masterfrom
kdschlosser wants to merge 1 commit intomhammond:masterfrom
Conversation
A traceback occurs when setting the Voice property in Sapi.SpVoice
code to reproduce the problem.
import win32com.client
import pythoncom
pythoncom.CoInitialize()
tts = win32com.client.Dispatch("Sapi.SpVoice")
tts.Voice = tts.GetVoices('Name=Microsoft Anna')[0]
The traceback
Traceback (most recent call last):
File "", line 6, in <module>
tts.Voice = tts.GetVoices('Name=Microsoft Anna')[0]
File "\win32com\client\dynamic.py", line 565, in __setattr__
self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value)
pywintypes.com_error: (-2147352573, 'Member not found.', None, None)
I have not come across anything that this fix causes an issue with. Because of the broad scope of com I am not able to test everything. This may give some insight on where the problem may lie.
Author
|
I apologize for the duplicate PR. i did not realize that someone had submitted a PR for this issue. I had checked Sourceforge some time ago and saw this issue had been reported several years ago. and upon downloading the latest version and saw the problem still existed. I decided to make a PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This problem can be reproduced very easily. The code and Traceback are as follows.
Code:
Traceback:
I have not come across anything that this fix causes an issue with. Because of the broad scope of com I am not able to test everything. This may give some insight on where the problem may lie, Or it could be the solution.
Thanks.
Kevin