Spaces:
Runtime error
Runtime error
Commit
·
ae6b6a0
1
Parent(s):
f2657c4
remove blocking func
Browse files
app.py
CHANGED
@@ -210,21 +210,23 @@ class DB_Search(BaseTool):
|
|
210 |
raise NotImplementedError("N/A")
|
211 |
|
212 |
def Text2Sound(text):
|
213 |
-
global speech_synthesizer
|
214 |
-
speech_synthesis_result = speech_synthesizer.speak_text_async(text).get()
|
215 |
-
if speech_synthesis_result.reason == speechsdk.ResultReason.SynthesizingAudioCompleted:
|
216 |
-
|
217 |
-
elif speech_synthesis_result.reason == speechsdk.ResultReason.Canceled:
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
|
|
|
|
224 |
|
225 |
Text2Sound_tool = Tool(
|
226 |
name = "Text To Sound",
|
227 |
-
func =
|
228 |
# func = Text2Sound.run,
|
229 |
description = "Useful when you need to convert text into sound file."
|
230 |
)
|
|
|
210 |
raise NotImplementedError("N/A")
|
211 |
|
212 |
def Text2Sound(text):
|
213 |
+
# global speech_synthesizer
|
214 |
+
# speech_synthesis_result = speech_synthesizer.speak_text_async(text).get()
|
215 |
+
# if speech_synthesis_result.reason == speechsdk.ResultReason.SynthesizingAudioCompleted:
|
216 |
+
# print("Speech synthesized for text [{}]".format(text))
|
217 |
+
# elif speech_synthesis_result.reason == speechsdk.ResultReason.Canceled:
|
218 |
+
# cancellation_details = speech_synthesis_result.cancellation_details
|
219 |
+
# print("Speech synthesis canceled: {}".format(cancellation_details.reason))
|
220 |
+
# if cancellation_details.reason == speechsdk.CancellationReason.Error:
|
221 |
+
# if cancellation_details.error_details:
|
222 |
+
# print("Error details: {}".format(cancellation_details.error_details))
|
223 |
+
# print("Did you set the speech resource key and region values?")
|
224 |
+
print("test")
|
225 |
+
pass
|
226 |
|
227 |
Text2Sound_tool = Tool(
|
228 |
name = "Text To Sound",
|
229 |
+
func = Text2Sound,
|
230 |
# func = Text2Sound.run,
|
231 |
description = "Useful when you need to convert text into sound file."
|
232 |
)
|