Mridul
commited on
Commit
•
6e388d5
1
Parent(s):
75592b9
Added a reset parameter
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import tempfile
|
|
10 |
import helper as hp
|
11 |
from io import BytesIO
|
12 |
|
13 |
-
|
14 |
|
15 |
st.title("Human Voice Activity Detector")
|
16 |
|
@@ -50,6 +50,7 @@ if record_button:
|
|
50 |
#upload audio file with streamlit
|
51 |
else:
|
52 |
audio_file = st.file_uploader("Upload Audio", type=["wav"])
|
|
|
53 |
|
54 |
if audio_file is not None:
|
55 |
# Save the uploaded audio file to a temporary file
|
@@ -112,7 +113,7 @@ if audio_file is not None:
|
|
112 |
print("No Speech Detected")
|
113 |
st.error("No Speech Detected")
|
114 |
|
115 |
-
if st.session_state['recording_done']:
|
116 |
if st.button("Reset", ):
|
117 |
st.session_state["recording_state"] = False
|
118 |
st.rerun()
|
|
|
10 |
import helper as hp
|
11 |
from io import BytesIO
|
12 |
|
13 |
+
reset = False
|
14 |
|
15 |
st.title("Human Voice Activity Detector")
|
16 |
|
|
|
50 |
#upload audio file with streamlit
|
51 |
else:
|
52 |
audio_file = st.file_uploader("Upload Audio", type=["wav"])
|
53 |
+
reset = True
|
54 |
|
55 |
if audio_file is not None:
|
56 |
# Save the uploaded audio file to a temporary file
|
|
|
113 |
print("No Speech Detected")
|
114 |
st.error("No Speech Detected")
|
115 |
|
116 |
+
if st.session_state['recording_done'] or reset:
|
117 |
if st.button("Reset", ):
|
118 |
st.session_state["recording_state"] = False
|
119 |
st.rerun()
|