Пример #1
0
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
Пример #2
0
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)
Пример #3
0
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))
Пример #4
0
def witVoice():
    wit.voice_query_start("RB3ED7T4K2AU7KMI6JWL7VSXKRVU4YAC")
    time.sleep(4)
    response = wit.voice_query_stop()
    #print("Response: {}".format(response))
    return response
Пример #5
0
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()

Пример #6
0
def witVoice():
    wit.voice_query_start(key)
    time.sleep(czasMowy)
    response = wit.voice_query_stop()

    return response
Пример #7
0
def witVoice():
    wit.voice_query_start(key)
    time.sleep(czasMowy)
    response = wit.voice_query_stop()

    return response
Пример #8
0
def witVoice():
    wit.voice_query_start("RB3ED7T4K2AU7KMI6JWL7VSXKRVU4YAC")
    time.sleep(czasMowy) 
    response = wit.voice_query_stop()

    return response
Пример #9
0
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()