Historical migration: Python 2.5 to 3.0 (core 0.21 to 0.22). For a current upgrade, start with the upgrade guide and compatibility matrix.
Audio is mono only
process() and buffer() take a 1D array. The internal mixdown is gone.VAD is its own object
Vad runs a dedicated VAD model. Energy-based VAD is removed.Quick migration checklist
1
Downmix to mono
Pass a 1D
float32 array to process(), process_async() and buffer(). A 2D array now raises AudioConfigMismatchError.2
Rename the config fields
num_frames is block_size, allow_variable_frames is variable_block_size and num_channels is gone.3
Rename get_processor_context
It is now
get_context() on both Processor and ProcessorAsync.4
Replace the processor-owned VAD
Create a
Vad or VadAsync from a dedicated VAD model. get_vad_context() no longer exists.5
Update the three renamed error classes
NotInitializedError, ProcessingNotAllowedError and FilePathInvalidError.6
Keep model types in the right objects
Processor takes enhancement and bypass models only. Vad takes VAD models only.Renames
ProcessorConfig
ProcessorConfig is shared by Processor, Vad and Collector.
Model
Processor and ProcessorAsync
ProcessorContext
The rename says what the value delays.
get_audio_delay() reports how far the enhanced samples lag their input. It no longer covers VAD timing, because the VAD has its own get_prediction_delay().
ProcessorContext.reset() now affects enhancement state only. Reset a VAD through its own VadContext.
Errors
Migrate enhancement
soundfile:
mean(axis=1) preserves the float32 dtype used here. The explicit cast also handles inputs such as integers, whose mean defaults to float64. process() requires a contiguous array; use np.ascontiguousarray for non-contiguous slices.Processor per channel. Each one holds the state for exactly one stream.
Migrate VAD
Async VAD
VadAsync mirrors ProcessorAsync:
VadContext
VadContext gained the methods the processor context already had:
These names match the C API’s
aic_processor_context_get_audio_delay and aic_vad_context_get_prediction_delay.Model types are enforced
A mismatch raises
ModelTypeUnsupportedError at creation time.
Session termination
Processor, Vad and Analyzer can now close their telemetry session explicitly, instead of waiting for garbage collection:
Validation
- Confirm every
process(),process_async()andbuffer()call receives a contiguous 1Dfloat32array. - Confirm no code still reads
config.num_frames,config.num_channelsorconfig.allow_variable_frames. - Search for
get_processor_contextandget_vad_context. - Search for the three renamed error classes, including in
exceptclauses. - Compare speech detection against representative audio after retuning sensitivity.
- Compare enhancement output level against representative recordings if you previously relied on the internal mixdown and mixback.
Need help?
- See the GitHub repository and the type stubs file.
- Browse available models at artifacts.ai-coustics.io.
- Check the compatibility matrix for binding, core and model file versions.