diff --git a/main/xiaozhi-server/core/providers/asr/base.py b/main/xiaozhi-server/core/providers/asr/base.py index 25a503829..effc6195c 100644 --- a/main/xiaozhi-server/core/providers/asr/base.py +++ b/main/xiaozhi-server/core/providers/asr/base.py @@ -259,13 +259,21 @@ class ASRProviderBase(ABC): conn.asr_text_buffer = raw_text # Turn Detection: let turn detection handle end of turn - if conn.turn_detection: - # Turn detection will wait for endpoint delay, then call on_end_of_turn - conn.turn_detection.check_end_of_turn(conn) - return + # if conn.turn_detection: + # # Turn detection will wait for endpoint delay, then call on_end_of_turn + # conn.turn_detection.check_end_of_turn(conn) + # return - # No Turn Detection: process immediately - await conn.on_end_of_turn() + # # No Turn Detection: process immediately + # 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: logger.bind(tag=TAG).error(f"Process speech segment failed: {e}") diff --git a/main/xiaozhi-server/custom_config.yaml b/main/xiaozhi-server/custom_config.yaml index 4ff88c187..a1def65d3 100644 --- a/main/xiaozhi-server/custom_config.yaml +++ b/main/xiaozhi-server/custom_config.yaml @@ -1129,9 +1129,9 @@ TTS: # ============================= Module Selection ================================ # =============================================================================== selected_module: - # VAD: FsmnVAD - VAD: SileroVAD - TurnDetection: NoopTurnDetection # Set to TenTurnDetection to enable + VAD: FsmnVAD + # VAD: SileroVAD + TurnDetection: TenTurnDetection # Set to TenTurnDetection to enable ASR: GroqASR # ASR: ByteplusStreamASR # LLM: GroqLLM