Fix indent error
This commit is contained in:
@@ -213,26 +213,26 @@ 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
|
||||||
|
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()
|
||||||
|
|
||||||
|
self._last_vad_status = 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()
|
|
||||||
|
|
||||||
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
|
||||||
if self._is_bot_speaking:
|
if self._is_bot_speaking:
|
||||||
|
|||||||
Reference in New Issue
Block a user