Spaces:
Runtime error
Runtime error
marigold334
commited on
Commit
•
620ca40
1
Parent(s):
4936e8e
Update app.py (#7)
Browse files- Update app.py (316bcd4b2a8e00d7faf796a1eab13e3d2ff6fe39)
app.py
CHANGED
@@ -74,11 +74,11 @@ def generate_voice(input_text):
|
|
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/
|
78 |
|
79 |
# Play audio
|
80 |
-
st.audio(f"cache_sound/
|
81 |
-
os.remove(f"cache_sound/
|
82 |
st.caption("Generated Voice")
|
83 |
|
84 |
|
|
|
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(f"cache_sound/new_generated.wav", format = "audio/wav")
|
81 |
+
os.remove(f"cache_sound/new_generated.wav")
|
82 |
st.caption("Generated Voice")
|
83 |
|
84 |
|