
Ausgabe 09.02.2018 Copyright by Joy-IT 6
3Talking-Pi
First run the following command to open the googlecloudtalkingpi.py le:
Add the following phrases to the except phrases in the same way as you did with your self-added phrases:
The following command integraons are also added as you did with your own:
Save your changes with the key combinaon CTRL+O and close the editor with the combinaon CTRL+X.
sudo nano /home/pi/voice-recognizer-raspi/src/googlecloudtalkingpi.py
recognizer.expect_phrase('Dreh dich')
recognizer.expect_phrase('Streck dich')
recognizer.expect_phrase('Greif zu')
elif 'Dreh dich' in text:
subprocess.call(["python","/home/pi/Robot/robotRotate.py"])
subprocess.Popen(["aplay", "/home/pi/GassistPi/src/resources/dong.wav"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(2)
elif 'Streck dich' in text:
subprocess.call(["python","/home/pi/Robot/robotStretch.py"])
subprocess.Popen(["aplay", "/home/pi/GassistPi/src/resources/dong.wav"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(2)
elif 'Greif zu' in text:
subprocess.call(["python","/home/pi/Robot/robotGrab.py"])
subprocess.Popen(["aplay", "/home/pi/GassistPi/src/resources/dong.wav"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(2)