Spaces:
Runtime error
Runtime error
marigold334
commited on
Commit
•
cd9a4b8
1
Parent(s):
620ca40
Update app.py
Browse files
app.py
CHANGED
@@ -72,12 +72,9 @@ def centered_text(input_text, mode = "h1",):
|
|
72 |
def generate_voice(input_text):
|
73 |
# TTS Inference
|
74 |
voice = st.session_state.TTS.inference(input_text)
|
75 |
-
|
76 |
-
# Save audio (bug in Streamlit, can't play numpy array directly)
|
77 |
-
sf.write(f"cache_sound/new_generated.wav", voice, 22050)
|
78 |
|
79 |
# Play audio
|
80 |
-
st.audio(
|
81 |
os.remove(f"cache_sound/new_generated.wav")
|
82 |
st.caption("Generated Voice")
|
83 |
|
|
|
72 |
def generate_voice(input_text):
|
73 |
# TTS Inference
|
74 |
voice = st.session_state.TTS.inference(input_text)
|
|
|
|
|
|
|
75 |
|
76 |
# Play audio
|
77 |
+
st.audio(voice,sample_rate = 22050)
|
78 |
os.remove(f"cache_sound/new_generated.wav")
|
79 |
st.caption("Generated Voice")
|
80 |
|