Skip to main content

aic_processor_process_interleaved

Function aic_processor_process_interleaved 

Source
pub unsafe extern "C" fn aic_processor_process_interleaved(
    processor: *mut AicProcessor,
    audio: *mut f32,
    num_channels: u16,
    num_frames: usize,
) -> Type
Expand description

Processes audio with interleaved channels in a single buffer.

Enhances speech in the provided audio buffer in-place.

Memory Layout:

  • Single contiguous buffer with channels interleaved
  • Buffer size: num_channels * num_frames floats
  • Example for 2 channels, 4 frames: audio -> [ch0_f0, ch1_f0, ch0_f1, ch1_f1, ch0_f2, ch1_f2, ch0_f3, ch1_f3]

§Parameters

  • processor: Initialized processor instance. Must not be NULL.
  • audio: Single buffer containing interleaved audio data of size num_channels * num_frames. Must not be NULL.
  • num_channels: Number of channels (must match initialization).
  • num_frames: Number of samples per channel (must match initialization value, or if allow_variable_frames was enabled, must be ≤ initialization value).

§Note

All channels are mixed to mono for processing. To process channels independently, create separate processor instances.

§Returns

  • AIC_ERROR_CODE_SUCCESS: Audio processed successfully
  • AIC_ERROR_CODE_NULL_POINTER: processor or audio is NULL
  • AIC_ERROR_CODE_NOT_INITIALIZED: Processor has not been initialized
  • AIC_ERROR_CODE_AUDIO_CONFIG_MISMATCH: Channel or frame count mismatch
  • AIC_ERROR_CODE_ENHANCEMENT_NOT_ALLOWED: SDK key was not authorized or process failed to report usage. Check if you have internet connection.

§Safety

  • Real-time safe: Can be called from audio processing threads.
  • This function is not thread-safe. Do not call this function from multiple threads.