using subprocess
This commit is contained in:
@@ -1,18 +1,15 @@
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
import os
|
from subprocess import call
|
||||||
|
|
||||||
|
|
||||||
def robot(text):
|
def robot(text):
|
||||||
print("executing command")
|
print("executing command")
|
||||||
command = 'espeak --stdin "' + text + '" | aplay -D plughw:2,0 '
|
call(['espeak', '--stdin', '"Hello world how are you doing today?"', '|', 'aplay', '-D', 'plughw:2,0'])
|
||||||
os.system(command)
|
|
||||||
return command
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print("initializing")
|
print("initializing")
|
||||||
command = robot("Hello world how are you doing today?")
|
command = robot("Hello world how are you doing today?")
|
||||||
|
|||||||
Reference in New Issue
Block a user