Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -129,8 +129,12 @@ def text_to_speech(text, audio_file=None):
|
|
| 129 |
# Convert the generated speech to numpy array format
|
| 130 |
speech_np = speech.cpu().numpy()
|
| 131 |
|
| 132 |
-
#
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
iface = gr.Interface(
|
| 136 |
fn=text_to_speech,
|
|
|
|
| 129 |
# Convert the generated speech to numpy array format
|
| 130 |
speech_np = speech.cpu().numpy()
|
| 131 |
|
| 132 |
+
# Save the speech to a temporary file in WAV format
|
| 133 |
+
output_file = "output.wav"
|
| 134 |
+
sf.write(output_file, speech_np, 16000)
|
| 135 |
+
|
| 136 |
+
# Return the path to the audio file
|
| 137 |
+
return output_file
|
| 138 |
|
| 139 |
iface = gr.Interface(
|
| 140 |
fn=text_to_speech,
|