diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e1e4c34..ca876830f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed an issue in `AudioBufferProcessor` where user callback would not be + called on task cancellation. + - Fixed an issue where `ElevenLabsTTSService` messages would return a 1009 websocket error by increasing the max message size limit to 16MB. diff --git a/src/pipecat/processors/audio/audio_buffer_processor.py b/src/pipecat/processors/audio/audio_buffer_processor.py index 7500a3f9e..eb92c8109 100644 --- a/src/pipecat/processors/audio/audio_buffer_processor.py +++ b/src/pipecat/processors/audio/audio_buffer_processor.py @@ -91,7 +91,7 @@ class AudioBufferProcessor(FrameProcessor): if self._buffer_size > 0 and len(self._user_audio_buffer) > self._buffer_size: await self._call_on_audio_data_handler() - if isinstance(frame, EndFrame): + if isinstance(frame, (CancelFrame, EndFrame)): await self._call_on_audio_data_handler() await self.push_frame(frame, direction)