Spaces:
Runtime error
Runtime error
Alexander Seifert
commited on
Commit
·
5ac50f7
1
Parent(s):
aeb977f
always show video/audio
Browse files
app.py
CHANGED
@@ -69,14 +69,14 @@ def run():
|
|
69 |
|
70 |
cutoff = audio_b64 = None
|
71 |
if audio_file or url:
|
72 |
-
with st.expander(("Audio" if audio_file else "Video") + " abspielen"):
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
|
81 |
if input_is_ready(password, audio_file, url) and submit_button:
|
82 |
# my_bar = st.progress(0)
|
|
|
69 |
|
70 |
cutoff = audio_b64 = None
|
71 |
if audio_file or url:
|
72 |
+
# with st.expander(("Audio" if audio_file else "Video") + " abspielen"):
|
73 |
+
if audio_file:
|
74 |
+
st.audio(audio_file)
|
75 |
+
cutoff = None if password == os.environ["ROOT_PASSWORD"] else 60_000
|
76 |
+
audio_file = AudioSegment.from_file(audio_file)[:cutoff]
|
77 |
+
audio_b64 = base64.b64encode(audio_file.export().read()).decode("ascii")
|
78 |
+
if url:
|
79 |
+
st.video(url)
|
80 |
|
81 |
if input_is_ready(password, audio_file, url) and submit_button:
|
82 |
# my_bar = st.progress(0)
|