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
vad_result = self.vad_processor.process(pcm_bytes, settings.chunk_size_ms)
vad_status = "Silence"
if vad_result:
event_type, probability = vad_result
vad_status = "Speech" if event_type == "speaking" else "Silence"
vad_status = "Silence"
if vad_result:
event_type, probability = vad_result
vad_status = "Speech" if event_type == "speaking" else "Silence"
# Emit VAD event
await self.event_bus.publish(event_type, {
"trackId": self.session_id,
"probability": probability
})
else:
# No state change - keep previous status
vad_status = self._last_vad_status
# Emit VAD event
await self.event_bus.publish(event_type, {
"trackId": self.session_id,
"probability": probability
})
else:
# No state change - keep previous status
vad_status = self._last_vad_status
# Update state based on VAD
if vad_status == "Speech" and self._last_vad_status != "Speech":
await self._on_speech_start()
# Update state based on VAD
if vad_status == "Speech" and self._last_vad_status != "Speech":
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)
# Filter false interruptions by requiring minimum speech duration