From d75815ba4891534ff02347bf011f2541768da70e Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Mon, 5 May 2025 17:39:18 -0300 Subject: [PATCH] Fixed an audio mixer issue when used alongside `SmallWebRTCTransport`. --- CHANGELOG.md | 9 +++++++++ src/pipecat/transports/network/small_webrtc.py | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21abadaee..13c8233ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to **Pipecat** will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Refactored how the `start` method is handled in `SmallWebRTCOutputTransport` by + initializing it before the parent class. This fixes an audio mixer issue when used + alongside `SmallWebRTCTransport`, preventing unnecessary CPU usage and avoiding the + output being flooded with silent frames when no new audio is available. + ## [0.0.66] - 2025-05-02 ### Added diff --git a/src/pipecat/transports/network/small_webrtc.py b/src/pipecat/transports/network/small_webrtc.py index fdd501299..9dff5cb60 100644 --- a/src/pipecat/transports/network/small_webrtc.py +++ b/src/pipecat/transports/network/small_webrtc.py @@ -484,9 +484,10 @@ class SmallWebRTCOutputTransport(BaseOutputTransport): self._params = params async def start(self, frame: StartFrame): - await super().start(frame) await self._client.setup(self._params, frame) await self._client.connect() + # Parent start. + await super().start(frame) async def stop(self, frame: EndFrame): await super().stop(frame)