Spaces:
Running
Running
Devin Xie
commited on
Commit
•
d0b52af
1
Parent(s):
a2f1abf
added sample inputs
Browse files- .gitignore +0 -1
- app.py +15 -9
- sample_inputs/rogan.wav +3 -0
- sample_inputs/stewie.wav +3 -0
- sample_inputs/trump.wav +3 -0
.gitignore
CHANGED
@@ -1,2 +1 @@
|
|
1 |
-
*.wav
|
2 |
.voice_env
|
|
|
|
|
1 |
.voice_env
|
app.py
CHANGED
@@ -28,14 +28,21 @@ def main():
|
|
28 |
title = f"""<h2 align="center" style="font-size: 1.2rem; margin-bottom: 2rem;">Make your favorite characters say anything!</h2>"""
|
29 |
st.markdown(title, unsafe_allow_html=True)
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
# Upload audio file
|
32 |
uploaded_file = st.file_uploader('Add an audio file of the voice you want to clone...', type=['wav'])
|
|
|
|
|
|
|
33 |
|
34 |
-
if
|
35 |
-
|
36 |
-
|
37 |
-
st.header('Reference Audio')
|
38 |
-
st.audio(uploaded_file, format='audio/wav')
|
39 |
|
40 |
# Input text
|
41 |
text_input = st.text_input('What do you want your character to say? (Alphabet letters only, DO NOT INCLUDE PUNCTUATION)')
|
@@ -44,11 +51,10 @@ def main():
|
|
44 |
if text_input:
|
45 |
try:
|
46 |
with st.spinner('Synthesizing...'):
|
47 |
-
output_path = generate_audio(
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
st.audio(output_path, format='audio/wav')
|
52 |
except:
|
53 |
st.error('There was an issue synthesizing the text. Please check the input and try again. Remember, do not include punctuation.')
|
54 |
else:
|
|
|
28 |
title = f"""<h2 align="center" style="font-size: 1.2rem; margin-bottom: 2rem;">Make your favorite characters say anything!</h2>"""
|
29 |
st.markdown(title, unsafe_allow_html=True)
|
30 |
|
31 |
+
sample_files = {
|
32 |
+
'Stewie Griffin': 'sample_inputs/stewie.wav',
|
33 |
+
'Donald Trump': 'sample_inputs/trump.wav',
|
34 |
+
'Joe Rogan': 'sample_inputs/rogan.wav'
|
35 |
+
}
|
36 |
+
|
37 |
# Upload audio file
|
38 |
uploaded_file = st.file_uploader('Add an audio file of the voice you want to clone...', type=['wav'])
|
39 |
+
selected_sample = st.selectbox('Or choose a sample:', list(sample_files.keys()))
|
40 |
+
|
41 |
+
speaker_file = sample_files[selected_sample] if uploaded_file is None else uploaded_file
|
42 |
|
43 |
+
if speaker_file:
|
44 |
+
st.header('Reference Audio')
|
45 |
+
st.audio(uploaded_file, format='audio/wav')
|
|
|
|
|
46 |
|
47 |
# Input text
|
48 |
text_input = st.text_input('What do you want your character to say? (Alphabet letters only, DO NOT INCLUDE PUNCTUATION)')
|
|
|
51 |
if text_input:
|
52 |
try:
|
53 |
with st.spinner('Synthesizing...'):
|
54 |
+
output_path = generate_audio(speaker_file, text_input)
|
55 |
|
56 |
+
st.header('Synthesized Audio')
|
57 |
+
st.audio(output_path, format='audio/wav')
|
|
|
58 |
except:
|
59 |
st.error('There was an issue synthesizing the text. Please check the input and try again. Remember, do not include punctuation.')
|
60 |
else:
|
sample_inputs/rogan.wav
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7443710c741b5716007a7e89e0c9448779c23adbce258e78c84615dc0f7bd6d0
|
3 |
+
size 8559872
|
sample_inputs/stewie.wav
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8559147ae1b5ac2b7925365e42604d05764fd812a214bdcc60d1169f67b380e0
|
3 |
+
size 5667310
|
sample_inputs/trump.wav
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:235b7d7b4d40d0a80808644964a5f01dbca68ebc7043a61f03661cebe9061437
|
3 |
+
size 8698620
|