This example shows how to use ADF APIs to connect DuerOS3.0
This example is will run on boards marked with green checkbox. Please remember to select the board in menuconfig as discussed is section Usage below.
Board Name | Getting Started | Chip | Compatible |
---|---|---|---|
ESP32-LyraT | |||
ESP32-LyraTD-MSC | |||
ESP32-LyraT-Mini | |||
ESP32-Korvo-DU1906 | |||
ESP32-S2-Kaluga-1 Kit |
Prepare the audio board:
- Connect speakers or headphones to the board.
- Insert a microSD card loaded with file
tone/DingDing.wav
into board's slot.
Configure the example:
- Select compatible audio board in
menuconfig
>Audio HAL
. - Set up the Wi-Fi connection by running
menuconfig
>Example Configuration
and filling inWiFi SSID
andWiFi Password
. - Select your DuerOS device profile instead of
ADF_PATH/components/dueros_service/duer_profile
. If you don't have a DuerOS device profile, please refer to DuerOS Developer Certification Guide and apply for a DuerOS Developer Account.
Load and run the example.
- Say "Hi Lexin" to trigger the DuerOS voice interaction, green LED will turn on for indicate wakeup, if the
DingDing.wav
exist in microSD, "Dingding" should be heard at same time. - Press [Rec] button to talk to DuerOS. The device will play back the DuerOS response. You can say anything you want, e.g."今天天气怎么样?" or "现在几点了?", which means "What's the weather today?" or " what time is it?".
- The green LED indicates Wi-Fi status:
- Green LED on if Wi-Fi connected
- Green LED blinks normally if Wi-Fi disconnected
- Green LED fast blinks if Wi-Fi is under setting
- Adjust volume via [Vol-] or [Vol+]
- Configure Wi-Fi by [Set] button
- DuerOS profile is device unique ID.
- There is a specific configuration for DuerOS example, please refer to sdkconfig.defaults.
- There is a limitation in touch driver that it takes a lot of CPU, and the impacts are either system can't be waken up by voice or system will play music with stutter. The workaround is not to use the following code at
duer_service_create
.
periph_touch_cfg_t touch_cfg = {
.touch_mask = TOUCH_PAD_SEL4 | TOUCH_PAD_SEL7 | TOUCH_PAD_SEL8 | TOUCH_PAD_SEL9,
.tap_threshold_percent = 70,
};
esp_periph_handle_t touch_periph = periph_touch_init(&touch_cfg);
esp_periph_start(touch_periph);