valiyevfagan commited on
Commit
fefa1f4
·
verified ·
1 Parent(s): ebdcb95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -175,7 +175,7 @@ def render_labeling_ui():
175
  # Audio player
176
  try:
177
  audio_bytes = load_audio_bytes(audio_folder, current_filename)
178
- render_audio_player(audio_bytes)
179
  except FileNotFoundError:
180
  st.error(f"Audio file not found: {current_filename}. Please contact admin.")
181
 
@@ -186,10 +186,10 @@ def render_labeling_ui():
186
  value=1.0,
187
  key="speed_slider",
188
  )
189
- # Update playback rate via JS
190
  st.markdown(
191
  f"""<script>
192
- var audio = document.getElementById('audio-player');
193
  if (audio) {{ audio.playbackRate = {speed}; }}
194
  </script>""",
195
  unsafe_allow_html=True,
 
175
  # Audio player
176
  try:
177
  audio_bytes = load_audio_bytes(audio_folder, current_filename)
178
+ render_audio_player(audio_bytes, str(current_index))
179
  except FileNotFoundError:
180
  st.error(f"Audio file not found: {current_filename}. Please contact admin.")
181
 
 
186
  value=1.0,
187
  key="speed_slider",
188
  )
189
+ player_id = f"audio-player-{current_index}"
190
  st.markdown(
191
  f"""<script>
192
+ var audio = document.getElementById('{player_id}');
193
  if (audio) {{ audio.playbackRate = {speed}; }}
194
  </script>""",
195
  unsafe_allow_html=True,