def listen(intents): while True: wit.voice_query_start(wit_access_token) time.sleep(6) response = json.loads(wit.voice_query_stop()) print response if len(response['outcomes']) > 0 and response['outcomes'][0]['intent'] == 'start_listen': break shutdown = False while not shutdown: print '\nActive Mode\n' wit.voice_query_start(wit_access_token) time.sleep(5) response = json.loads(wit.voice_query_stop()) print response, 'respsssssssss' print('Response: {}'.format(response)) for outcome in response['outcomes']: if outcome['intent'] in intents: if outcome['intent'] == 'youtube': print 'sending request' intents[outcome['intent']](outcome['entities']['search_query'][0]['value']) elif intents[outcome['intent']]() == True: return listen(intents) break
def get_response(): wit.init() wit.voice_query_start('I5FO3XJWG7M5NYLBTDIN44VUQ6YEOBGI') # start recording time.sleep(2) # let's speak for 2 seconds a = json.loads(wit.voice_query_stop()) wit.close() print(a)
def main(): # initialize WIT.AI wit.init() wit.voice_query_start(WIT_AI_KEY) time.sleep(3) response = wit.voice_query_stop() wit.close() # case for the keyword voice command checkStartup(getIntent(response))
def witVoice(): wit.voice_query_start("RB3ED7T4K2AU7KMI6JWL7VSXKRVU4YAC") time.sleep(4) response = wit.voice_query_stop() #print("Response: {}".format(response)) return response
import wit import time wit.init() while(True): wit.voice_query_start("GQ5ETCLIQOZNLVEQWLCRMZK7IGGGYP23") time.sleep(5) response = wit.voice_query_stop() print("Response: {}".format(response)) wit.close()
def witVoice(): wit.voice_query_start(key) time.sleep(czasMowy) response = wit.voice_query_stop() return response
def witVoice(): wit.voice_query_start("RB3ED7T4K2AU7KMI6JWL7VSXKRVU4YAC") time.sleep(czasMowy) response = wit.voice_query_stop() return response
import wit import time if __name__ == "__main__": wit.init() wit.voice_query_start("ACCESS_TOKEN") time.sleep(2) response = wit.voice_query_stop() print("Response: {}".format(response)) wit.close()