Gong Junmin commited on
Commit
fa05c34
·
1 Parent(s): 2d1c19e

fix audio play position reset

Browse files
acestep/gradio_ui/events/results_handlers.py CHANGED
@@ -878,10 +878,12 @@ def generate_with_progress(
878
  # The lrc_display was already updated in the loop yields above.
879
  # lrc_display.change() event will automatically update the audio subtitles.
880
  # This decouples audio value updates from subtitle updates, avoiding flickering.
881
-
882
  yield (
883
  # Audio - just skip, subtitles are updated via lrc_display.change()
884
- gr.skip(), gr.skip(), gr.skip(), gr.skip(), gr.skip(), gr.skip(), gr.skip(), gr.skip(),
 
 
885
  all_audio_paths,
886
  generation_info,
887
  "Generation Complete",
 
878
  # The lrc_display was already updated in the loop yields above.
879
  # lrc_display.change() event will automatically update the audio subtitles.
880
  # This decouples audio value updates from subtitle updates, avoiding flickering.
881
+ audio_playback_updates = [gr.update(playback_position=0) for _ in range(8)]
882
  yield (
883
  # Audio - just skip, subtitles are updated via lrc_display.change()
884
+ # gr.skip(), gr.skip(), gr.skip(), gr.skip(), gr.skip(), gr.skip(), gr.skip(), gr.skip(),
885
+ audio_playback_updates[0], audio_playback_updates[1], audio_playback_updates[2], audio_playback_updates[3],
886
+ audio_playback_updates[4], audio_playback_updates[5], audio_playback_updates[6], audio_playback_updates[7],
887
  all_audio_paths,
888
  generation_info,
889
  "Generation Complete",