From 7f79208ef5d1e3209792449011a0fcfb42343d64 Mon Sep 17 00:00:00 2001 From: talksik Date: Thu, 27 Apr 2023 16:47:46 -0700 Subject: [PATCH] printing command --- basic_text_to_speech/talk.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/basic_text_to_speech/talk.py b/basic_text_to_speech/talk.py index 0aaccd8..1f20619 100644 --- a/basic_text_to_speech/talk.py +++ b/basic_text_to_speech/talk.py @@ -4,14 +4,17 @@ import os def robot(text): - os.system('espeak --stdin "' + text + '" | aplay -D plughw:2,0 ') + command = 'espeak --stdin "' + text + '" | aplay -D plughw:2,0 ' + os.system(command) + return command if __name__ == '__main__': while True: try: - robot("Hello world how are you doing today?") + command = robot("Hello world how are you doing today?") + print(command) time.sleep(5) except KeyboardInterrupt: break