Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -118,7 +118,7 @@ def detect_language(text):
|
|
118 |
|
119 |
### 4️⃣ TTS Functionality (KokoroTTS)
|
120 |
@spaces.GPU(duration=1000)
|
121 |
-
def generate_audio_kokoro(text, lang):
|
122 |
"""Generate speech using KokoroTTS for supported languages."""
|
123 |
global kokoro_tts # Access the preloaded model
|
124 |
lang_code = SUPPORTED_TTS_LANGUAGES.get(lang, "a") # Default to English
|
@@ -189,7 +189,8 @@ with gr.Blocks() as demo:
|
|
189 |
process_audio_button.click(
|
190 |
generate_audio_kokoro,
|
191 |
#inputs=[extracted_text, detected_language],
|
192 |
-
inputs=[extracted_text, metadata_output, voice_selection],
|
|
|
193 |
outputs=[full_audio_output]
|
194 |
)
|
195 |
|
|
|
118 |
|
119 |
### 4️⃣ TTS Functionality (KokoroTTS)
|
120 |
@spaces.GPU(duration=1000)
|
121 |
+
def generate_audio_kokoro(text, lang, selected_voice):
|
122 |
"""Generate speech using KokoroTTS for supported languages."""
|
123 |
global kokoro_tts # Access the preloaded model
|
124 |
lang_code = SUPPORTED_TTS_LANGUAGES.get(lang, "a") # Default to English
|
|
|
189 |
process_audio_button.click(
|
190 |
generate_audio_kokoro,
|
191 |
#inputs=[extracted_text, detected_language],
|
192 |
+
#inputs=[extracted_text, metadata_output, voice_selection],
|
193 |
+
inputs=[extracted_text, metadata_output["Detected Language"], voice_selection],
|
194 |
outputs=[full_audio_output]
|
195 |
)
|
196 |
|