Spaces:
Sleeping
Sleeping
Phạm Anh Tuấn
commited on
Commit
•
58cbd5a
1
Parent(s):
98cf224
adjust style
Browse files
app.py
CHANGED
@@ -1,28 +1,18 @@
|
|
1 |
import streamlit as st
|
2 |
-
# from gtts import gTTS
|
3 |
-
import io
|
4 |
import torch
|
5 |
from TTS.api import TTS
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
-
# tts = gTTS(text)
|
10 |
-
# audio = tts.save("output.mp3")
|
11 |
-
# return audio
|
12 |
-
|
13 |
-
st.title("Voice Synthesis App")
|
14 |
# Get device
|
15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
16 |
-
|
17 |
-
# List available 🐸TTS models
|
18 |
-
print(TTS().list_models())
|
19 |
-
|
20 |
# Init TTS
|
21 |
tts = TTS("tts_models/en/ljspeech/overflow").to(device)
|
22 |
|
23 |
# Input form for the user to enter text
|
24 |
user_input = st.text_area("Enter the text:")
|
25 |
-
|
|
|
26 |
if user_input:
|
27 |
# audio = text_to_audio(user_input)
|
28 |
|
@@ -44,5 +34,3 @@ if st.button("Generate"):
|
|
44 |
file_name="output.wav",
|
45 |
mime="audio/wav",
|
46 |
)
|
47 |
-
|
48 |
-
st.write("Note: This app uses gTTS for text-to-speech conversion.")
|
|
|
1 |
import streamlit as st
|
|
|
|
|
2 |
import torch
|
3 |
from TTS.api import TTS
|
4 |
|
5 |
+
# Set Page Title
|
6 |
+
st.title("Text to Speech with Overflow")
|
|
|
|
|
|
|
|
|
|
|
7 |
# Get device
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
|
|
|
|
|
9 |
# Init TTS
|
10 |
tts = TTS("tts_models/en/ljspeech/overflow").to(device)
|
11 |
|
12 |
# Input form for the user to enter text
|
13 |
user_input = st.text_area("Enter the text:")
|
14 |
+
|
15 |
+
if st.button("Synthesize"):
|
16 |
if user_input:
|
17 |
# audio = text_to_audio(user_input)
|
18 |
|
|
|
34 |
file_name="output.wav",
|
35 |
mime="audio/wav",
|
36 |
)
|
|
|
|