Files
rpi-random-projects/basic_text_to_speech/talk.py
T
2023-04-27 16:55:12 -07:00

23 lines
490 B
Python

import time
from subprocess import call
def robot(text):
print("executing command")
call(['espeak', '--stdin', '"Hello world how are you doing today?"',
'|', 'aplay', '-D plughw:2,0'])
if __name__ == '__main__':
while True:
try:
print("initializing")
command = robot("Hello world how are you doing today?")
print(command)
time.sleep(10)
except KeyboardInterrupt:
break
time.sleep(1)