@@ -323,6 +323,7 @@ def _prepare_config(
323323 diarization = "speaker" if config .enable_diarization else None ,
324324 enable_partials = True ,
325325 max_delay = config .max_delay ,
326+ max_delay_mode = "fixed" ,
326327 audio_filtering_config = {
327328 "volume_threshold" : 0.0 ,
328329 },
@@ -653,8 +654,12 @@ async def emit() -> None:
653654 if self ._turn_id != _turn_id :
654655 return
655656
657+ # Guard against EOT being called when no segments are in the buffer
658+ if end_of_turn and self ._current_view and self ._current_view .has_no_active_segments_remaining ():
659+ return
660+
656661 # Emit segments or finalize STT message (only for ADAPTIVE and SMART_TURN)
657- if self . _uses_forced_eou and end_of_turn :
662+ if end_of_turn and self . _uses_forced_eou :
658663 await self ._await_forced_eou ()
659664
660665 # Check if the turn has changed
@@ -682,8 +687,6 @@ def end_of_turn(self) -> None:
682687 >>> client.end_of_turn()
683688 """
684689
685- print ("*** EOT called ***" )
686-
687690 # Emit the finalize or use EndOfTurn on demand preview
688691 self .finalize (end_of_turn = True )
689692
@@ -1657,7 +1660,7 @@ def _handle_speaker_stopped(self, speaker_end_time: float) -> None:
16571660
16581661 def _next_fragment_id (self ) -> int :
16591662 """Return the next fragment ID."""
1660- self ._fragment_idx += 1
1663+ self ._fragment_idx += 10
16611664 return self ._fragment_idx
16621665
16631666 def _get_endpoint_url (self , url : str , app : Optional [str ] = None ) -> str :
0 commit comments