AudioBufferProcessor: call callback on CancelFrame

This commit is contained in:
Aleix Conchillo Flaqué
2025-01-31 11:04:43 -08:00
parent fc89aad469
commit 13611fd8e1
2 changed files with 4 additions and 1 deletions

View File

@@ -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.

View File

@@ -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)