OuroborosM commited on
Commit
1d1fa7f
·
1 Parent(s): d0d56b0

correct t2sound hmi

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -1361,7 +1361,8 @@ def Text2Sound_HMI():
1361
  global Filename_Chatbot
1362
  global Audio_output
1363
  print("Last answer in Text2Sound_HMI", last_answer)
1364
- text_to_speech_2(last_answer)
 
1365
  Filename_Chatbot = Audio_output[-1]
1366
  print("Filename_Chatbot in Text2Sound_HMI", Filename_Chatbot)
1367
  # try:
@@ -1399,14 +1400,14 @@ def SingleTalk(WavFile, history5):
1399
  # real_content = response[-1:]
1400
  # print("real_content", real_content)
1401
  try:
1402
- temp = response.split("(sandbox:/")[1] # (sandbox:/sample-20230805-0807.wav)
1403
- file_name = temp.split(")")[0]
1404
  print("file_name:", file_name)
1405
- history2 = history2 + [(None, (file_name,))]
1406
- Filename_Chatbot = file_name
1407
- yield [None, None, history2]
1408
- except:
1409
- print("No need to add file in chatbot")
 
1410
 
1411
  except Exception as e:
1412
  print("chathmi3 SingleTalk error:", e)
 
1361
  global Filename_Chatbot
1362
  global Audio_output
1363
  print("Last answer in Text2Sound_HMI", last_answer)
1364
+ # text_to_speech_2(last_answer)
1365
+ text_to_speech_loc2(last_answer)
1366
  Filename_Chatbot = Audio_output[-1]
1367
  print("Filename_Chatbot in Text2Sound_HMI", Filename_Chatbot)
1368
  # try:
 
1400
  # real_content = response[-1:]
1401
  # print("real_content", real_content)
1402
  try:
1403
+ file_name = CheckFileinResp(response)
 
1404
  print("file_name:", file_name)
1405
+ if file_name is not "N/A":
1406
+ history2 = history2 + [(None, (file_name,))]
1407
+ Filename_Chatbot = file_name
1408
+ yield [None, None, history2]
1409
+ except Exception as e:
1410
+ print("No need to add file in chatbot:", e)
1411
 
1412
  except Exception as e:
1413
  print("chathmi3 SingleTalk error:", e)