-
-
Notifications
You must be signed in to change notification settings - Fork 345
added text to speech feature #420
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||||||||||||||||||||||||||||||
import pyttsx3 | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
engine =pyttsx3.init() | ||||||||||||||||||||||||||||||||||
voices= engine.getProperty("voices") | ||||||||||||||||||||||||||||||||||
for i in voices: | ||||||||||||||||||||||||||||||||||
print(i.id) | ||||||||||||||||||||||||||||||||||
print(i.name) | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
id ="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_DAVID_11.0" | ||||||||||||||||||||||||||||||||||
Comment on lines
+3
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Missing space before assignment operator. Should be 'voices = engine.getProperty("voices")' for consistent formatting.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Missing space after assignment operator. Should be 'id = "HKEY_LOCAL_MACHINE...' for consistent formatting.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||
engine.setProperty(i, id) | ||||||||||||||||||||||||||||||||||
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded Windows-specific voice ID makes the code non-portable. Consider selecting a voice from the available voices list or adding platform detection.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||
engine.setProperty("rate",176) | ||||||||||||||||||||||||||||||||||
Comment on lines
+5
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using undefined variable 'i' from the previous loop. The loop variable 'i' is out of scope here. Should use 'voice' property name like 'voice' instead.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Magic number 176 for speech rate should be defined as a named constant or documented with a comment explaining the chosen value.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||
engine.say("hello world") | ||||||||||||||||||||||||||||||||||
engine.runAndWait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing space after assignment operator. Should be 'engine = pyttsx3.init()' for consistent formatting.
Copilot uses AI. Check for mistakes.