Fix indent error

This commit is contained in:
Xin Wang
2026-02-06 08:40:42 +08:00
parent a70970fee5
commit f81a561e0e

View File

@@ -213,25 +213,25 @@ class DuplexPipeline:
# 1. Process through VAD # 1. Process through VAD
vad_result = self.vad_processor.process(pcm_bytes, settings.chunk_size_ms) vad_result = self.vad_processor.process(pcm_bytes, settings.chunk_size_ms)
vad_status = "Silence" vad_status = "Silence"
if vad_result: if vad_result:
event_type, probability = vad_result event_type, probability = vad_result
vad_status = "Speech" if event_type == "speaking" else "Silence" vad_status = "Speech" if event_type == "speaking" else "Silence"
# Emit VAD event # Emit VAD event
await self.event_bus.publish(event_type, { await self.event_bus.publish(event_type, {
"trackId": self.session_id, "trackId": self.session_id,
"probability": probability "probability": probability
}) })
else: else:
# No state change - keep previous status # No state change - keep previous status
vad_status = self._last_vad_status vad_status = self._last_vad_status
# Update state based on VAD # Update state based on VAD
if vad_status == "Speech" and self._last_vad_status != "Speech": if vad_status == "Speech" and self._last_vad_status != "Speech":
await self._on_speech_start() await self._on_speech_start()
self._last_vad_status = vad_status self._last_vad_status = vad_status
# 2. Check for barge-in (user speaking while bot speaking) # 2. Check for barge-in (user speaking while bot speaking)
# Filter false interruptions by requiring minimum speech duration # Filter false interruptions by requiring minimum speech duration