Update main.py
Browse files
main.py
CHANGED
|
@@ -5,7 +5,7 @@ import time
|
|
| 5 |
import logging
|
| 6 |
from pipecat.frames.frames import (
|
| 7 |
TextFrame, UserStartedSpeakingFrame, UserStoppedSpeakingFrame,
|
| 8 |
-
TTSStartedFrame,
|
| 9 |
)
|
| 10 |
from pipecat.pipeline.pipeline import Pipeline
|
| 11 |
from pipecat.pipeline.runner import PipelineRunner
|
|
@@ -64,7 +64,7 @@ class SilenceAndCallLogicProcessor(FrameProcessor):
|
|
| 64 |
self._reset_activity_timer()
|
| 65 |
if isinstance(frame, TTSStartedFrame) and direction == FrameDirection.DOWNSTREAM:
|
| 66 |
self._bot_is_speaking = True
|
| 67 |
-
elif isinstance(frame,
|
| 68 |
self._bot_is_speaking = False
|
| 69 |
self.last_activity_ts = time.time()
|
| 70 |
await self.push_frame(frame, direction)
|
|
|
|
| 5 |
import logging
|
| 6 |
from pipecat.frames.frames import (
|
| 7 |
TextFrame, UserStartedSpeakingFrame, UserStoppedSpeakingFrame,
|
| 8 |
+
TTSStartedFrame, TTSStoppedFrame
|
| 9 |
)
|
| 10 |
from pipecat.pipeline.pipeline import Pipeline
|
| 11 |
from pipecat.pipeline.runner import PipelineRunner
|
|
|
|
| 64 |
self._reset_activity_timer()
|
| 65 |
if isinstance(frame, TTSStartedFrame) and direction == FrameDirection.DOWNSTREAM:
|
| 66 |
self._bot_is_speaking = True
|
| 67 |
+
elif isinstance(frame, TTSStoppedFrame) and direction == FrameDirection.DOWNSTREAM:
|
| 68 |
self._bot_is_speaking = False
|
| 69 |
self.last_activity_ts = time.time()
|
| 70 |
await self.push_frame(frame, direction)
|