# Audio AFE Voice Command Example ## Introduction This example extends [audio_afe](../audio_afe) with MultiNet voice command detection. After wake word detection, the device listens for voice commands within a timeout window and logs recognized commands. Flow: `audio_recorder` (AFE + wakeup + vcmd) → `audio_feeder` loopback, with wakeup prompt playback on `WAKEUP_START`. ## Hardware Requirements Same as [audio_afe](../audio_afe). Tested on boards with microphone array and speaker, such as **ESP32-S3-KORVO2-V3** or **ESP32-S31-KORVO1**. ## Feature Description Compared to `audio_afe`, this example additionally enables: - `AV_PROCESSOR_AFE_FLAG_VCMD_DETECT_ENABLE` in AFE config - WakeNet model: `Hi,乐鑫` (`CONFIG_SR_WN_WN9_HILEXIN`) - MultiNet model: `mn7_cn` (`CONFIG_SR_MN_CN_MULTINET7_QUANT`) ### Usage Flow 1. Say the wake word (e.g. "Hi,乐鑫") → prompt tone plays 2. Within the vcmd timeout window (default 5 s), speak a MultiNet command 3. Recognized commands are logged as `VCMD_DETECTED` 4. Processed audio continues to loop back through the speaker ## Usage Instructions 1. Run `. ./prebuild.sh` and select the development board 2. Select a board, e.g. `idf.py gen-bmgr-config -b esp32_s31_korvo1` 3. Build and flash: `idf.py flash monitor -p PORT` 4. SPIFFS prompt files are shared from [audio_afe/spiffs](../audio_afe/spiffs) ## Configuration Parameters - Sample rate: 16000 Hz - Bit depth: 16 bit - Channels: 1 (recorder output) - Frame duration: 20 ms - Vcmd timeout: 5000 ms (from `DEFAULT_AV_PROCESSOR_AFE_CONFIG()`) - MultiNet language: `cn` - Prompt file: `file://spiffs/I_comeon_wakeup.wav`
To create a project from this example, run:
idf.py create-project-from-example "jason-mao/av_processor=0.7.0:audio_afe_vcmd"