-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor/test: Created speak_response_with_input.py
created the above script which will accept an input in voice after speaking. Needs more work, but for this I need to refactor other parts first, mainly the wakeword and command JSON file usage as mentioned in #9
- Loading branch information
Showing
3 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# very similar in function to speak_response.py, except, this one waits for an input after speaking the response | ||
import pyttsx3 as tts | ||
import utils.voice_recognizer as voice_recognizer | ||
|
||
|
||
def speak_response(response): | ||
# Initialize text-to-speech | ||
speaker = tts.init() | ||
# Set how fast it will talk. | ||
speaker.setProperty("rate", 175) | ||
speaker.setProperty('voice', voices[0].id) | ||
speaker.say(response) | ||
speaker.runAndWait() | ||
|
||
|
||
|
||
#voice_recognizer.run(wakeword, commands, type) |