Update tts.py
Browse files
tts.py
CHANGED
@@ -31,8 +31,8 @@ def synthesize_speech(text):
|
|
31 |
|
32 |
# Decode the generated speech and save to an audio file
|
33 |
waveform = speech.cpu().numpy().flatten()
|
34 |
-
# Convert waveform to audio format that Gradio can handle
|
35 |
sf.write("output.wav", waveform, 16000)
|
|
|
36 |
return "output.wav"
|
37 |
except Exception as e:
|
38 |
logging.error(f"Error during speech synthesis: {e}")
|
|
|
31 |
|
32 |
# Decode the generated speech and save to an audio file
|
33 |
waveform = speech.cpu().numpy().flatten()
|
|
|
34 |
sf.write("output.wav", waveform, 16000)
|
35 |
+
logging.info("Audio file saved successfully.")
|
36 |
return "output.wav"
|
37 |
except Exception as e:
|
38 |
logging.error(f"Error during speech synthesis: {e}")
|