Spaces:
Sleeping
Sleeping
Commit
·
5621132
1
Parent(s):
eb2c78c
Update pages/4_Trying Out(Guess the Phrase).py
Browse files
pages/4_Trying Out(Guess the Phrase).py
CHANGED
@@ -37,7 +37,9 @@ initialize_level()
|
|
37 |
def step_page():
|
38 |
st.header("Tryit Out")
|
39 |
|
40 |
-
input_type = st.selectbox(
|
|
|
|
|
41 |
audio_file = None
|
42 |
if input_type == "Upload":
|
43 |
uploaded_file = st.file_uploader("Upload a file", type=["wav", "mp3", "flac"])
|
@@ -58,15 +60,12 @@ def step_page():
|
|
58 |
elif input_type == "Sample":
|
59 |
audio_file = "assets/sample1.flac"
|
60 |
elif input_type == "Pilot 1":
|
61 |
-
audio_file = "assets/pilot1.
|
62 |
elif input_type == "Pilot 2":
|
63 |
-
audio_file = "assets/pilot2.
|
64 |
|
65 |
if audio_file:
|
66 |
-
|
67 |
-
st.audio(audio_file, format="audio/flac")
|
68 |
-
elif audio_file.endswith(".mp3"):
|
69 |
-
st.audio(audio_file, format="audio/mp3")
|
70 |
|
71 |
transcript = st.text_input("What did you hear?")
|
72 |
if st.button("Check") and transcript:
|
|
|
37 |
def step_page():
|
38 |
st.header("Tryit Out")
|
39 |
|
40 |
+
input_type = st.selectbox(
|
41 |
+
"Input Type", ["Upload", "Record", "Sample", "Pilot 1", "Pilot 2"], index=2
|
42 |
+
)
|
43 |
audio_file = None
|
44 |
if input_type == "Upload":
|
45 |
uploaded_file = st.file_uploader("Upload a file", type=["wav", "mp3", "flac"])
|
|
|
60 |
elif input_type == "Sample":
|
61 |
audio_file = "assets/sample1.flac"
|
62 |
elif input_type == "Pilot 1":
|
63 |
+
audio_file = "assets/pilot1.flac"
|
64 |
elif input_type == "Pilot 2":
|
65 |
+
audio_file = "assets/pilot2.flac"
|
66 |
|
67 |
if audio_file:
|
68 |
+
st.audio(audio_file, format="audio/flac")
|
|
|
|
|
|
|
69 |
|
70 |
transcript = st.text_input("What did you hear?")
|
71 |
if st.button("Check") and transcript:
|