J.P Lee 2023-12-07
Fix: Omitting the last chunk problem in comp_unaware mode
@a432dbb5c7bbabf3c424245beef064a6019ce504
whisper_online.py
--- whisper_online.py
+++ whisper_online.py
@@ -573,10 +573,15 @@
 
             print(f"## last processed {end:.2f}s",file=logfile,flush=True)
 
-            beg = end
-            end += min_chunk
             if end >= duration:
                 break
+            
+            beg = end
+            
+            if end + min_chunk > duration:
+                end = duration
+            else:
+                end += min_chunk
         now = duration
 
     else: # online = simultaneous mode
Add a comment
List