Spaces:
Runtime error
Runtime error
Commit
·
ada225d
1
Parent(s):
a1c334d
link sound
Browse files
app.py
CHANGED
@@ -898,6 +898,13 @@ def ClearAudio():
|
|
898 |
|
899 |
return None
|
900 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
901 |
global last_answer
|
902 |
last_answer = ""
|
903 |
|
@@ -1024,7 +1031,9 @@ with gr.Blocks() as demo:
|
|
1024 |
upload_button.upload(func_upload_file, [upload_button, chatbot], chatbot)
|
1025 |
agentchoice.change(SetAgent, agentchoice, None)
|
1026 |
frash_logs.click(read_logs, None, logs)
|
1027 |
-
voice_input.stop_recording(SingleTalk, [voice_input, chatbot], [voice_input, voice_output, chatbot])
|
|
|
|
|
1028 |
success(ClearAudio, None, voice_output)
|
1029 |
# voice_output.end(ClearAudio, None, voice_output)
|
1030 |
# def clear_voice():
|
|
|
898 |
|
899 |
return None
|
900 |
|
901 |
+
def Text2Sound_HMI():
|
902 |
+
global last_answer
|
903 |
+
global Filename_Chatbot
|
904 |
+
global Audio_output
|
905 |
+
text_to_speech_2(last_answer)
|
906 |
+
Filename_Chatbot = Audio_output[0]
|
907 |
+
|
908 |
global last_answer
|
909 |
last_answer = ""
|
910 |
|
|
|
1031 |
upload_button.upload(func_upload_file, [upload_button, chatbot], chatbot)
|
1032 |
agentchoice.change(SetAgent, agentchoice, None)
|
1033 |
frash_logs.click(read_logs, None, logs)
|
1034 |
+
voice_input.stop_recording(SingleTalk, [voice_input, chatbot], [voice_input, voice_output, chatbot]).\
|
1035 |
+
success(Text2Sound_HMI,None,None).\
|
1036 |
+
success(playsound, None, voice_output).\
|
1037 |
success(ClearAudio, None, voice_output)
|
1038 |
# voice_output.end(ClearAudio, None, voice_output)
|
1039 |
# def clear_voice():
|