Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -114,12 +114,17 @@ def tts_fn(slider_value, input_text):
|
|
114 |
|
115 |
|
116 |
def master_fn(slider_value, input_text):
|
117 |
-
|
118 |
-
|
119 |
-
sampling_rate_response,
|
120 |
-
all_speech.append(audio_chunk_response)
|
121 |
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
return sampling_rate_response, audio_response
|
124 |
|
125 |
import gradio as gr
|
|
|
114 |
|
115 |
|
116 |
def master_fn(slider_value, input_text):
|
117 |
+
if "." not in input_text:
|
118 |
+
sampling_rate_response, audio_chunk_response = tts_fn(slider_value, input_text)
|
119 |
+
return sampling_rate_response, audio_response
|
|
|
120 |
|
121 |
+
else :
|
122 |
+
all_speech = []
|
123 |
+
for sentence in input_text.split(".")[:-1]:
|
124 |
+
sampling_rate_response, audio_chunk_response = tts_fn(slider_value, sentence)
|
125 |
+
all_speech.append(audio_chunk_response)
|
126 |
+
|
127 |
+
audio_response = np.concatenate(all_speech)
|
128 |
return sampling_rate_response, audio_response
|
129 |
|
130 |
import gradio as gr
|