SPACERUNNER99 commited on
Commit
97d83d9
·
verified ·
1 Parent(s): 1218a3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -255,7 +255,7 @@ def transcribe(audio):
255
  segments, info = model.transcribe(audio)
256
  segments = list(segments)
257
  for segment in segments:
258
- print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
259
  return segments
260
 
261
  def format_time(seconds):
@@ -354,8 +354,8 @@ def time_to_seconds(time_obj):
354
  def create_subtitle_clips(subtitles, videosize, fontsize, font, color, debug):
355
  subtitle_clips = []
356
  for subtitle in subtitles:
357
- start_time = time_to_seconds(subtitle.start)+1 # Add 2 seconds offset
358
- end_time = time_to_seconds(subtitle.end)+1
359
  duration = end_time - start_time
360
  video_width, video_height = videosize
361
  max_width = video_width * 0.8
 
255
  segments, info = model.transcribe(audio)
256
  segments = list(segments)
257
  for segment in segments:
258
+ print("[%.2fs -> %.2fs] %s" % (segment.start+1, segment.end+1, segment.text))
259
  return segments
260
 
261
  def format_time(seconds):
 
354
  def create_subtitle_clips(subtitles, videosize, fontsize, font, color, debug):
355
  subtitle_clips = []
356
  for subtitle in subtitles:
357
+ start_time = time_to_seconds(subtitle.start) # Add 2 seconds offset
358
+ end_time = time_to_seconds(subtitle.end)
359
  duration = end_time - start_time
360
  video_width, video_height = videosize
361
  max_width = video_width * 0.8