Spaces:
Runtime error
Runtime error
Upload app_minimal.py
Browse files- app_minimal.py +2 -1
app_minimal.py
CHANGED
|
@@ -27,7 +27,8 @@ def generate_speech(text, voice):
|
|
| 27 |
# Normalize audio
|
| 28 |
audio = audio / np.max(np.abs(audio)) if np.max(np.abs(audio)) > 0 else audio
|
| 29 |
|
| 30 |
-
|
|
|
|
| 31 |
|
| 32 |
except Exception as e:
|
| 33 |
return None, f"❌ Error generating speech: {str(e)}"
|
|
|
|
| 27 |
# Normalize audio
|
| 28 |
audio = audio / np.max(np.abs(audio)) if np.max(np.abs(audio)) > 0 else audio
|
| 29 |
|
| 30 |
+
# Return in the format expected by Gradio Audio component: (sample_rate, audio_data)
|
| 31 |
+
return (24000, audio), f"✅ Successfully generated speech with voice: {voice}"
|
| 32 |
|
| 33 |
except Exception as e:
|
| 34 |
return None, f"❌ Error generating speech: {str(e)}"
|