greg0rs commited on
Commit
ced276b
·
verified ·
1 Parent(s): 8ba6297

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -1099,8 +1099,14 @@ async def transcribe(audio: UploadFile = File(...), similarity_threshold: float
1099
  # Update expanded_start for accurate timing logs
1100
  expanded_start += boundary_offset
1101
  log(f" Updated expanded start: {expanded_start:.3f}s")
 
 
 
 
 
 
1102
 
1103
- # Also extract WhisperX original timing for comparison
1104
  whisperx_audio_segment = extract_audio_segment(waveform, sample_rate, start_time, end_time, word_clean, verbose=False)
1105
 
1106
  # Detect phoneme from expanded audio segment
 
1099
  # Update expanded_start for accurate timing logs
1100
  expanded_start += boundary_offset
1101
  log(f" Updated expanded start: {expanded_start:.3f}s")
1102
+
1103
+ # ALSO apply the boundary offset to WhisperX timing
1104
+ original_start_time = start_time
1105
+ start_time = max(0, start_time + boundary_offset)
1106
+ end_time = max(start_time + 0.01, end_time) # Ensure minimum 10ms duration
1107
+ log(f" Updated WhisperX timing: {original_start_time:.3f}s → {start_time:.3f}s (shifted +{boundary_offset:.3f}s)")
1108
 
1109
+ # Also extract WhisperX original timing for comparison (now using updated start_time)
1110
  whisperx_audio_segment = extract_audio_segment(waveform, sample_rate, start_time, end_time, word_clean, verbose=False)
1111
 
1112
  # Detect phoneme from expanded audio segment