From 2a29cb18a5bccdba886cff7329249d2de752eaee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 13 Jun 2024 15:30:41 -0700 Subject: [PATCH] transports(base_output): chunk audio into 20ms instead of 10ms --- src/pipecat/transports/base_output.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pipecat/transports/base_output.py b/src/pipecat/transports/base_output.py index d46201294..2a1461563 100644 --- a/src/pipecat/transports/base_output.py +++ b/src/pipecat/transports/base_output.py @@ -59,11 +59,11 @@ class BaseOutputTransport(FrameProcessor): self._stopped_event = asyncio.Event() self._is_interrupted = threading.Event() - # We will send 10ms audio which is the smallest possible amount of audio - # we can send. If we receive long audio frames we will chunk them into - # 10ms. This will help with interruption handling. - self._audio_chunk_size = int(self._params.audio_out_sample_rate / 100) * \ + # We will write 20ms audio at a time. If we receive long audio frames we + # will chunk them. This will help with interruption handling. + audio_bytes_10ms = int(self._params.audio_out_sample_rate / 100) * \ self._params.audio_out_channels * 2 + self._audio_chunk_size = audio_bytes_10ms * 2 # Create push frame task. This is the task that will push frames in # order. We also guarantee that all frames are pushed in the same task.