Adding some comments to the code.

This commit is contained in:
Filipi Fuchter
2025-04-16 09:11:27 -03:00
parent cd8bd7f487
commit 8e36bdbed7

View File

@@ -244,11 +244,13 @@ class BaseInputTransport(FrameProcessor):
if self._params.end_of_turn_analyzer:
is_speech = vad_state == VADState.SPEAKING or vad_state == VADState.STARTING
# If silence exceeds threshold, we are going to receive EndOfTurnState.COMPLETE
end_of_turn_state = self._params.end_of_turn_analyzer.append_audio(
frame.audio, is_speech
)
if end_of_turn_state == EndOfTurnState.COMPLETE:
await self._handle_end_of_turn_complete(end_of_turn_state)
# Otherwise we are going to trigger to check if the turn is completed based on the VAD
elif vad_state == VADState.QUIET and vad_state != previous_vad_state:
await self._handle_end_of_turn()