# Audio SR/VC Switching Example ## Overview This example demonstrates how to create two `audio_recorder` instances in one application: - one recorder with `AFE_TYPE_SR` - one recorder with `AFE_TYPE_VC` Both recorders are opened during startup, but only one route is active at a time. The example switches between them with `audio_recorder_pause()` and `audio_recorder_resume()`. ## Why this example matters In some products, you need both: - wakeup capability - strict quality requirements for post-AEC audio data One important point is: - `SR` is usually used for wakeup-related scenarios - when `SR` runs in wakeup mode, the post-AEC output is often not as good as `VC` So if your application requires wakeup, but you also care a lot about the quality of the audio after AEC, a practical solution is: - use `SR` when wakeup is needed - switch to `VC` when post-AEC audio quality is more important This example demonstrates exactly that workflow. ## How it works The example creates two recorder handles: - `sr`: `AFE_TYPE_SR`, with wakeup enabled - `vc`: `AFE_TYPE_VC`, without wakeup Switching is done by pausing one route and resuming the other route, instead of reopening the recorder each time. ## Console commands After boot, the console prompt is: ```text sr_vc> ``` Supported commands: - `rec sr` - `rec vc` - `rec pause` - `rec status` ## Recommendation If your use case needs wakeup and also has strict requirements on the post-AEC audio result, you can keep both `SR` and `VC` recorders alive and switch between them with `pause` and `resume`.
To create a project from this example, run:
idf.py create-project-from-example "jason-mao/av_processor=0.6.0:audio_sr_vc_switch"