trying another method to pipe to second command
This commit is contained in:
@@ -2,11 +2,16 @@ import time
|
|||||||
|
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
|
|
||||||
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
|
|
||||||
def robot(text):
|
def robot(text):
|
||||||
print("executing command")
|
print("executing command")
|
||||||
call(['espeak', '--stdin', '"Hello world how are you doing today?"',
|
espeak = Popen(
|
||||||
'|', 'aplay', '-D plughw:2,0'])
|
['espeak', '--stdin "Hello world how are you doing today?"'], stdout=PIPE)
|
||||||
|
aplay = Popen(['aplay', '-D plughw:2,0'], stdin=espeak.stdout, stdout=PIPE)
|
||||||
|
espeak.stdout.close() # enable write error in dd if ssh dies
|
||||||
|
out, err = aplay.communicate()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user