BaseOuputTransport: minor cleanup
This commit is contained in:
@@ -403,7 +403,7 @@ class BaseOutputTransport(FrameProcessor):
|
|||||||
# Last time a BotSpeakingFrame was pushed.
|
# Last time a BotSpeakingFrame was pushed.
|
||||||
self._bot_speaking_frame_time = 0
|
self._bot_speaking_frame_time = 0
|
||||||
# How often a BotSpeakingFrame should be pushed (value should be
|
# How often a BotSpeakingFrame should be pushed (value should be
|
||||||
# lower than the audio chunks).
|
# greater than the audio chunks to have any effect).
|
||||||
self._bot_speaking_frame_period = 0.2
|
self._bot_speaking_frame_period = 0.2
|
||||||
# Last time the bot actually spoke.
|
# Last time the bot actually spoke.
|
||||||
self._bot_speech_last_time = 0
|
self._bot_speech_last_time = 0
|
||||||
@@ -644,8 +644,7 @@ class BaseOutputTransport(FrameProcessor):
|
|||||||
|
|
||||||
diff_time = time.time() - self._bot_speaking_frame_time
|
diff_time = time.time() - self._bot_speaking_frame_time
|
||||||
if diff_time >= self._bot_speaking_frame_period:
|
if diff_time >= self._bot_speaking_frame_period:
|
||||||
await self._transport.push_frame(BotSpeakingFrame())
|
await self._transport.broadcast_frame(BotSpeakingFrame)
|
||||||
await self._transport.push_frame(BotSpeakingFrame(), FrameDirection.UPSTREAM)
|
|
||||||
self._bot_speaking_frame_time = time.time()
|
self._bot_speaking_frame_time = time.time()
|
||||||
|
|
||||||
self._bot_speech_last_time = time.time()
|
self._bot_speech_last_time = time.time()
|
||||||
|
|||||||
Reference in New Issue
Block a user