Spaces:
Running
Running
Devin Xie
commited on
Commit
·
32d3b7e
1
Parent(s):
6bb5b99
fixed bugs with sample inputs
Browse files
app.py
CHANGED
@@ -29,6 +29,7 @@ def main():
|
|
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'
|
@@ -38,11 +39,14 @@ def main():
|
|
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 |
-
|
|
|
|
|
|
|
42 |
|
43 |
if speaker_file:
|
44 |
st.header('Reference Audio')
|
45 |
-
st.audio(
|
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)')
|
|
|
29 |
st.markdown(title, unsafe_allow_html=True)
|
30 |
|
31 |
sample_files = {
|
32 |
+
'None': '',
|
33 |
'Stewie Griffin': 'sample_inputs/stewie.wav',
|
34 |
'Donald Trump': 'sample_inputs/trump.wav',
|
35 |
'Joe Rogan': 'sample_inputs/rogan.wav'
|
|
|
39 |
uploaded_file = st.file_uploader('Add an audio file of the voice you want to clone...', type=['wav'])
|
40 |
selected_sample = st.selectbox('Or choose a sample:', list(sample_files.keys()))
|
41 |
|
42 |
+
if selected_sample is not 'None':
|
43 |
+
speaker_file = sample_files[selected_sample]
|
44 |
+
if uploaded_file is not None:
|
45 |
+
speaker_file = uploaded_file
|
46 |
|
47 |
if speaker_file:
|
48 |
st.header('Reference Audio')
|
49 |
+
st.audio(speaker_file, format='audio/wav')
|
50 |
|
51 |
# Input text
|
52 |
text_input = st.text_input('What do you want your character to say? (Alphabet letters only, DO NOT INCLUDE PUNCTUATION)')
|