From ab6be11a0e06eabcd419db8a346dc71fafc4e46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 14 Apr 2025 08:30:56 -0700 Subject: [PATCH] SoundfileMixer: add mixing argument and require keywords --- CHANGELOG.md | 11 ++++++++++- src/pipecat/audio/mixers/soundfile_mixer.py | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 205339086..13a3c647d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- It is now possible to disable `SoundfileMixer` when created. You can then use + `MixerEnableFrame` to dynamically enable it when necessary. + +### Changed + +- `SoundfileMixer` constructor arguments need to be keywords. + ### Fixed -- Fixed an issue in `SmallWebRTCTransport` where an error was thrown if the +- Fixed an issue in `SmallWebRTCTransport` where an error was thrown if the client did not create a video transceiver. ## [0.0.63] - 2025-04-11 diff --git a/src/pipecat/audio/mixers/soundfile_mixer.py b/src/pipecat/audio/mixers/soundfile_mixer.py index 0c01be7fa..1628c4d8a 100644 --- a/src/pipecat/audio/mixers/soundfile_mixer.py +++ b/src/pipecat/audio/mixers/soundfile_mixer.py @@ -38,9 +38,11 @@ class SoundfileMixer(BaseAudioMixer): def __init__( self, + *, sound_files: Mapping[str, str], default_sound: str, volume: float = 0.4, + mixing: bool = True, loop: bool = True, **kwargs, ): @@ -52,7 +54,7 @@ class SoundfileMixer(BaseAudioMixer): self._sound_pos = 0 self._sounds: Dict[str, Any] = {} self._current_sound = default_sound - self._mixing = True + self._mixing = mixing self._loop = loop async def start(self, sample_rate: int):