Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -207,8 +207,9 @@ def generate_wordcloud(text):
|
|
207 |
def generate_audio_kokoro(text, lang, selected_voice):
|
208 |
"""Generate speech using KokoroTTS for supported languages."""
|
209 |
global kokoro_tts # Access the preloaded model
|
|
|
210 |
lang_code = SUPPORTED_TTS_LANGUAGES.get(lang, "a") # Default to English
|
211 |
-
#generator = kokoro_tts(text, voice="
|
212 |
generator = kokoro_tts(text, voice=selected_voice, speed=1, split_pattern=r'\n+')
|
213 |
|
214 |
# Generate and collect audio data
|
@@ -299,7 +300,7 @@ with gr.Blocks() as demo:
|
|
299 |
|
300 |
url_input = gr.Textbox(label="Enter URL", placeholder="https://example.com/article")
|
301 |
|
302 |
-
voice_selection = gr.Dropdown(AVAILABLE_VOICES, label="Select Voice", value="
|
303 |
tts_option = gr.Radio(["Summary Audio", "Raw Data Audio"], value="Summary Audio", label="Select TTS Source")
|
304 |
with gr.Row():
|
305 |
process_text_button = gr.Button("Fetch Text & Detect Language",scale = 1)
|
|
|
207 |
def generate_audio_kokoro(text, lang, selected_voice):
|
208 |
"""Generate speech using KokoroTTS for supported languages."""
|
209 |
global kokoro_tts # Access the preloaded model
|
210 |
+
yield None
|
211 |
lang_code = SUPPORTED_TTS_LANGUAGES.get(lang, "a") # Default to English
|
212 |
+
#generator = kokoro_tts(text, voice="bm_george", speed=1, split_pattern=r'\n+')
|
213 |
generator = kokoro_tts(text, voice=selected_voice, speed=1, split_pattern=r'\n+')
|
214 |
|
215 |
# Generate and collect audio data
|
|
|
300 |
|
301 |
url_input = gr.Textbox(label="Enter URL", placeholder="https://example.com/article")
|
302 |
|
303 |
+
voice_selection = gr.Dropdown(AVAILABLE_VOICES, label="Select Voice", value="bm_george")
|
304 |
tts_option = gr.Radio(["Summary Audio", "Raw Data Audio"], value="Summary Audio", label="Select TTS Source")
|
305 |
with gr.Row():
|
306 |
process_text_button = gr.Button("Fetch Text & Detect Language",scale = 1)
|