fix: Update ElevenLabsRealtimeSTTService to use VADUser speaking frames

This commit is contained in:
Mark Backman
2025-12-21 15:55:26 -05:00
parent d7d979dde1
commit 00bb08bacc
2 changed files with 36 additions and 15 deletions

View File

@@ -29,8 +29,8 @@ from pipecat.frames.frames import (
InterimTranscriptionFrame,
StartFrame,
TranscriptionFrame,
UserStartedSpeakingFrame,
UserStoppedSpeakingFrame,
VADUserStartedSpeakingFrame,
VADUserStoppedSpeakingFrame,
)
from pipecat.processors.frame_processor import FrameDirection
from pipecat.services.stt_service import SegmentedSTTService, WebsocketSTTService
@@ -551,10 +551,10 @@ class ElevenLabsRealtimeSTTService(WebsocketSTTService):
"""
await super().process_frame(frame, direction)
if isinstance(frame, UserStartedSpeakingFrame):
if isinstance(frame, VADUserStartedSpeakingFrame):
# Start metrics when user starts speaking
await self.start_metrics()
elif isinstance(frame, UserStoppedSpeakingFrame):
elif isinstance(frame, VADUserStoppedSpeakingFrame):
# Send commit when user stops speaking (manual commit mode)
if self._params.commit_strategy == CommitStrategy.MANUAL:
if self._websocket and self._websocket.state is State.OPEN: