def voice_talk(): answer_str = dss.queryByVoice() tts_result = tts.getText2VoiceStream(answer_str, "result_msg.wav") if answer_str == '': print("질문이 없었습니다.") return 0 elif tts_result == 500: print("TTS 동작에러입니다.") return 0 else: MS.play_file("result_msg.wav")
def main(): #Example8 Button+STT+DSS KWSID = ['기가지니', '지니야', '친구야', '자기야'] while 1: recog = kws.btn_test(KWSID[0]) if recog == 200: print('KWS Dectected ...\n Start STT...') text = dss.queryByVoice() if text == '': print('질의한 내용이 없습니다.') else: MS.play_file("result_mesg.wav") #time.sleep(2) else: print('KWS Not Dectected ...')
def main(): #Example8 KWS+STT+DSS KWSID = ['기가지니', '지니야', '친구야', '자기야'] while 1: recog = kws.test(KWSID[0]) if recog == 200: print('KWS Dectected ...\n') dss_answer = dss.queryByVoice() if dss_answer == '': print('질의한 내용이 없습니다.\n\n\n') else: MS.play_file("result_mesg.wav") time.sleep(2) else: print('KWS Not Dectected ...')
def main(): #Example8 Button+STT+DSS KWSID = ['기가지니', '지니야', '친구야', '자기야'] while 1: recog = kws.btn_test(KWSID[0]) if recog == 200: print('KWS Dectected ...\n Start STT...') text = dss.queryByVoice() tts_result = tts.getText2VoiceStream(text, "result_mesg.wav") if text == '': print('질의한 내용이 없습니다.') elif tts_result == 500: print("TTS 동작 에러입니다.\n") break else: MS.play_file("result_mesg.wav") time.sleep(2) else: print('KWS Not Dectected ...')
def main(): #Example8 KWS+STT+DSS KWSID = ['기가지니', '지니야', '친구야', '자기야'] while 1: recog=kws.test(KWSID[0]) if recog == 200: print('KWS Dectected ...\n') dssAnswer = dss.queryByVoice() ttsResult = tts.getText2VoiceStream(dssAnswer, "result_mesg.wav") if dssAnswer == '': print('질의한 내용이 없습니다.\n\n\n') elif ttsResult == 500: print("TTS 동작 에러입니다.\n\n\n") break else: kws.gkitAudio.playWav("result_mesg.wav") time.sleep(2) else: print('KWS Not Dectected ...')
def main(): #Example7 KWS+STT KWSID = ['기가지니', '지니야', '친구야', '자기야'] global but_commu but_commu = 0 gs_call() while 1: if but_commu == 0: time.sleep(5) recog1 = kws.test(KWSID[0]) if recog1 == 200: print('KWS Dectected …\n Start STT…') text = gv2t.getVoice2Text() print('Recognized Text: ' + text) tts.getText2VoiceStream(checkCommand(text), "result_TTS.wav") MS.play_file("result_TTS.wav") time.sleep(2) else: print('KWS Not Dectected …') if but_commu == 1: recog2 = kws.btn_test(KWSID[0]) if recog2 == 200: print('KWS Dectected ...\n Start STT...') text = dss.queryByVoice() tts_result = tts.getText2VoiceStream(text, "result_mesg.wav") if text == '': print('질의한 내용이 없습니다.') but_commu = 0 elif tts_result == 500: print("TTS 동작 에러입니다.\n") but_commu = 0 break else: MS.play_file("result_mesg.wav") but_commu = 0 time.sleep(2) else: print('KWS Not Dectected ...')