Merge pull request #56 from Plaud-AI/feat/demo

feat: rollback turn detection
This commit is contained in:
Harold-Guo 2025-12-18 18:46:31 +08:00 committed by GitHub
commit 6cdd5cee5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 9 deletions

View file

@ -259,13 +259,21 @@ class ASRProviderBase(ABC):
conn.asr_text_buffer = raw_text conn.asr_text_buffer = raw_text
# Turn Detection: let turn detection handle end of turn # Turn Detection: let turn detection handle end of turn
if conn.turn_detection: # if conn.turn_detection:
# Turn detection will wait for endpoint delay, then call on_end_of_turn # # Turn detection will wait for endpoint delay, then call on_end_of_turn
conn.turn_detection.check_end_of_turn(conn) # conn.turn_detection.check_end_of_turn(conn)
return # return
# No Turn Detection: process immediately # # No Turn Detection: process immediately
await conn.on_end_of_turn() # await conn.on_end_of_turn()
enhanced_text = self._build_enhanced_text(raw_text, speaker_name)
asr_report_time = int(time.time())
await startToChat(conn, enhanced_text)
# Note: For report, we need to convert PCM back to opus or use PCM directly
# For now, pass empty list as audio data for report
enqueue_asr_report(conn, enhanced_text, [], report_time=asr_report_time)
except Exception as e: except Exception as e:
logger.bind(tag=TAG).error(f"Process speech segment failed: {e}") logger.bind(tag=TAG).error(f"Process speech segment failed: {e}")

View file

@ -1129,9 +1129,9 @@ TTS:
# ============================= Module Selection ================================ # ============================= Module Selection ================================
# =============================================================================== # ===============================================================================
selected_module: selected_module:
# VAD: FsmnVAD VAD: FsmnVAD
VAD: SileroVAD # VAD: SileroVAD
TurnDetection: NoopTurnDetection # Set to TenTurnDetection to enable TurnDetection: TenTurnDetection # Set to TenTurnDetection to enable
ASR: GroqASR ASR: GroqASR
# ASR: ByteplusStreamASR # ASR: ByteplusStreamASR
# LLM: GroqLLM # LLM: GroqLLM