Spaces:
Runtime error
Runtime error
marigold334
commited on
Commit
•
b35e31e
1
Parent(s):
620ca40
Update app.py (#8)
Browse files- Update app.py (cd9a4b8068141e4f0e23b19fca55449d781ff41b)
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 |
|