fix: voice interrupt
This commit is contained in:
@ -415,6 +415,9 @@ class ESP32LiveKitBridge:
|
||||
if session.tts_active:
|
||||
print("跳过 tts start,当前已处于激活状态")
|
||||
return
|
||||
if time.monotonic() < session.tts_suppressed_until:
|
||||
print("跳过 tts start,中断后的残留音频仍在抑制窗口内")
|
||||
return
|
||||
if not session.tts_display_text:
|
||||
session.tts_transcript_text = ""
|
||||
session.tts_display_final = False
|
||||
@ -812,9 +815,7 @@ class ESP32LiveKitBridge:
|
||||
pre_roll_pcm.clear()
|
||||
audible_frame_streak = 0
|
||||
silence_frame_streak = 0
|
||||
waiting_for_post_interrupt_silence = (
|
||||
time.monotonic() >= session.tts_suppressed_until
|
||||
)
|
||||
waiting_for_post_interrupt_silence = True
|
||||
stream_id = session.tts_stream_id
|
||||
if session.tts_active:
|
||||
await self._stop_tts(session)
|
||||
@ -829,7 +830,7 @@ class ESP32LiveKitBridge:
|
||||
pre_roll_pcm.clear()
|
||||
audible_frame_streak = 0
|
||||
silence_frame_streak = 0
|
||||
waiting_for_post_interrupt_silence = False
|
||||
waiting_for_post_interrupt_silence = True
|
||||
continue
|
||||
|
||||
if waiting_for_post_interrupt_silence:
|
||||
|
||||
Reference in New Issue
Block a user