Skip to content

Commit

Permalink
Dueos:
Browse files Browse the repository at this point in the history
1. Add the introduction of `WenXinYiYan` to the description of example `DuerOS`.
2. Enable or disable AEC due to the hardware design.
  • Loading branch information
JosephTang authored and espressif-bot committed Jul 15, 2024
1 parent 5b5be9f commit c2f1232
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
8 changes: 8 additions & 0 deletions examples/dueros/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Among them, [esp audio](../../components/esp-adf-libs/esp_audio/include/esp_audi

In addition, you need to apply for the DuerOS profile on the [DuerOS Open Platform](https://dueros.baidu.com/didp/doc/overall/console-guide_markdown) in advance, and replace the empty file in `ADF_PATH/components/dueros_service/duer_profile`.

## `WenXinYiYan` support

This example can access to `WenXinYiYan` which provided by baidu. Interacting with the cloud through this example, responses from the AI can be obtained, providing richer and more intelligent answers.

To integrate "WenXinYiYan", a profile with feature enabled is needed. So, please enable this requirement when applying for the DuerOS profile.

With the correct profile and after compiling and flashing the profile and program as described below, we can interact with the AI after wake up the device.

## Environment Setup

### Hardware Required
Expand Down
8 changes: 8 additions & 0 deletions examples/dueros/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@

此外,本例程需要预先在 [百度 DuerOS 开放平台](https://dueros.baidu.com/didp/doc/overall/console-guide_markdown) 申请 DuerOS 的 profile,并替换 `ADF_PATH/components/dueros_service/duer_profile` 中的空文件。

## 文心一言

本例程已经支持接入百度`文心一言`,使用本例程与云端交互,可以得到来自大模型更加丰富与智能的结果。

接入`文心一言`需要使用开通此功能的 profile,在申请 DuerOS profile 时请明注意勾选该需求。

在有正确的 profile 并按照下文介绍的步骤编译并烧录 profile 与程序之后,唤醒设备就可以与`文心一言`进行交互。

## 环境配置

### 硬件要求
Expand Down
7 changes: 6 additions & 1 deletion examples/dueros/main/duer_audio_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
#define CODEC_ADC_BITS_PER_SAMPLE 16
#endif

#ifndef RECORD_HARDWARE_AEC
#warning "The hardware AEC is disabled!"
#define RECORD_HARDWARE_AEC (false)
#endif /* RECORD_HARDWARE_AEC */

#ifndef CODEC_ADC_I2S_PORT
#define CODEC_ADC_I2S_PORT (0)
#endif
Expand Down Expand Up @@ -246,7 +251,7 @@ void *duer_audio_start_recorder(rec_event_cb_t cb)
ESP_LOGI(TAG, "Recorder has been created");

recorder_sr_cfg_t recorder_sr_cfg = DEFAULT_RECORDER_SR_CFG();
recorder_sr_cfg.afe_cfg.aec_init = false;
recorder_sr_cfg.afe_cfg.aec_init = RECORD_HARDWARE_AEC;
recorder_sr_cfg.multinet_init = false;
recorder_sr_cfg.afe_cfg.memory_alloc_mode = AFE_MEMORY_ALLOC_MORE_PSRAM;
recorder_sr_cfg.afe_cfg.agc_mode = AFE_MN_PEAK_NO_AGC;
Expand Down

0 comments on commit c2f1232

Please sign in to comment.