AIC Voice Focus version update & concurrency safety issue on audio buffer.#3889
Merged
markbackman merged 5 commits intopipecat-ai:mainfrom Mar 3, 2026
Conversation
Snapshot the blocks into immutable bytes and trim the buffer BEFORE any await, so no memoryview is held across async yield points. Without this, a concurrent filter() or stop() call could try to extend() or clear() the bytearray while a memoryview still exports it, raising "Existing exports of data: object cannot be re-sized".
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
ParameterFixedError is deprecated.
…ix in `AICFilter`.
markbackman
pushed a commit
to pipecat-ai/docs
that referenced
this pull request
Mar 11, 2026
- Updated model ID examples to include Voice Focus 2.0 format - Updated usage examples to use quail-vf-2.0-l-16khz model - Added note about Voice Focus 2.0 support with aic-sdk 2.1.0+ Reflects changes from pipecat-ai/pipecat#3889
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
AICFilter.filter()created amemoryviewonself._audio_buffer(abytearray) and held it alive across awaitself._processor.process_async(...). In production with concurrent calls, another task could runfilter()(calling_audio_buffer.extend()) orstop()(calling_audio_buffer.clear()) while thememoryviewstill exported the buffer, causing Python to raise:It's not easy to reproduce locally because it requires concurrent async interleaving but wrote a test for simulate it.
Fix
Replace the
memoryviewon the mutablebytearraywith abytessnapshot taken before any await:The extra copy is negligible — typical block size is 320 bytes (10ms of 16kHz 16-bit audio).