Spaces:
Sleeping
Sleeping
show audio for 1 click
Browse files- src/app.py +6 -2
src/app.py
CHANGED
@@ -81,12 +81,16 @@ if word:
|
|
81 |
on_select="rerun",
|
82 |
selection_mode="single-row")
|
83 |
if selected:
|
|
|
84 |
rows = selected["selection"].get("rows")
|
85 |
if rows:
|
86 |
row = rows[0]
|
87 |
text = result.iloc[row, 3]
|
88 |
start = result.iloc[row, 2].astype(float)
|
89 |
start_delta = timedelta(seconds=start)
|
90 |
-
st.
|
91 |
-
|
|
|
|
|
|
|
92 |
st.text(text)
|
|
|
81 |
on_select="rerun",
|
82 |
selection_mode="single-row")
|
83 |
if selected:
|
84 |
+
show_audio = False
|
85 |
rows = selected["selection"].get("rows")
|
86 |
if rows:
|
87 |
row = rows[0]
|
88 |
text = result.iloc[row, 3]
|
89 |
start = result.iloc[row, 2].astype(float)
|
90 |
start_delta = timedelta(seconds=start)
|
91 |
+
if st.button("オーディオを再生"):
|
92 |
+
show_audio = True
|
93 |
+
if show_audio:
|
94 |
+
st.write(f"Start time: {str(start_delta)}")
|
95 |
+
st.audio(result.iloc[row, 5], start_time=start-5.0)
|
96 |
st.text(text)
|