https://aiyprojects.withgoogle.com/voice/
https://github.com/wit-ai/pywit
1. ~ $ apt-get install python3-pip
2. ~ $ pip3 install mqtt-paho
1. ~ $ pip3 install urllib3
2. ~ $ pip3 install pyopenssl
3. ~ $ pip3 install ndg-httpsclient
4. ~ $ pip3 install pyasn1
5. ~ $ pip3 install requests[security]
1. ~ $ cd /etc/profile.d
2. ~ $ nano {$FILE_NAME}.sh
#!/bin/bash
python3.5 {$FILE PATH}.{$FILE_NAME}.py
~ $ reboot
#####- you can validate token in https://api.wit.ai check access_token.
def main():
while True:
access_token = "access_token"
client = Wit(access_token)
logger.info('Listening.....')
text = input()
if text:
logger.info('recognize text is : %s ',text)
try:
with Timeout(3):
resp = client.message(text)
logger.info(resp)
json_manager.saveJson(resp)
json_manager.decodeJson()
except Timeout.Timeout:
print('timeout')
except:
print('error resp')
if __name__ == '__main__':
main()
example : wit_mqtt_controller.py
or
wit_mqtt_controller_voice.py