User Manual

45
from pismart.stt import STT
from pismart.tts import TTS
p = PiSmart()
sr = STT('dictionary', name_calling=True, timeout=10.0, dictionary_update=True)
p.speaker_switch(1)
pico = TTS('pico')
while True:
sr.recognize()
print "heard :%s"%sr.heard
if sr.heard:
result = sr.result
print "=============================="
print result
print "=============================="
if result == '__NAME__':
pico.say = 'Hello there'
else:
pico.say = result
amateur.py
Integration module. The amateur file integrates most of the control part for PiSmart, though
the debugging and customization is not deep enough.
from pismart.amateur import PiSmart
my_pismart = PiSmart()
xxx_init()
Initialize resources on the PiSmart, with no parameters. When the amateur instance is created,
all the initialization will be executed.
SunFounder