BaseInputTransport: show VAD results when interruptions not allowed

This commit is contained in:
Aleix Conchillo Flaqué
2025-02-06 07:40:03 -08:00
parent 4c77c3ed34
commit ee9cce64b2

View File

@@ -130,10 +130,10 @@ class BaseInputTransport(FrameProcessor):
# #
async def _handle_interruptions(self, frame: Frame): async def _handle_interruptions(self, frame: Frame):
if self.interruptions_allowed:
# Make sure we notify about interruptions quickly out-of-band.
if isinstance(frame, UserStartedSpeakingFrame): if isinstance(frame, UserStartedSpeakingFrame):
logger.debug("User started speaking") logger.debug("User started speaking")
# Make sure we notify about interruptions quickly out-of-band.
if self.interruptions_allowed:
await self._start_interruption() await self._start_interruption()
# Push an out-of-band frame (i.e. not using the ordered push # Push an out-of-band frame (i.e. not using the ordered push
# frame task) to stop everything, specially at the output # frame task) to stop everything, specially at the output
@@ -141,6 +141,7 @@ class BaseInputTransport(FrameProcessor):
await self.push_frame(StartInterruptionFrame()) await self.push_frame(StartInterruptionFrame())
elif isinstance(frame, UserStoppedSpeakingFrame): elif isinstance(frame, UserStoppedSpeakingFrame):
logger.debug("User stopped speaking") logger.debug("User stopped speaking")
if self.interruptions_allowed:
await self._stop_interruption() await self._stop_interruption()
await self.push_frame(StopInterruptionFrame()) await self.push_frame(StopInterruptionFrame())