You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/ai_agent/coze_ws_app/README.md
+69-31Lines changed: 69 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,14 +24,25 @@ This example is built on the [ESP-GMF](https://github.com/espressif/esp-gmf) fra
24
24
25
25
### Hardware Preparation
26
26
27
-
- This example uses the esp32-s3-korvo-2 development board by default. For hardware details, please refer to the [documentation](https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/dev-boards/user-guide-esp32-s3-korvo-2.html).
28
-
To use a different board version, go to `menuconfig -> Example Configuration → Audio Board` to make your selection.
27
+
- This example defaults to the `esp32-s3-korvo-2` development board. For hardware reference, please see the related [documentation](https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/dev-boards/user-guide-esp32-s3-korvo-2.html). Other versions can be selected in `menuconfig->GMF APP Configuration → Target Board`.
29
28
30
-
> If you are using a custom development board, select Custom audio board and modify the corresponding IO configuration in the [esp_gmf_gpio_config.h](components/common/esp_gmf_gpio_config.h#162) file.
29
+
> If you are using a custom development board, you need to perform the following four steps:
31
30
32
-
### About encoding formats
31
+
1. Redefine the IO pins and codec chip related to your development board in managed_components->tempotian__codec_board->board_cfg.txt.
32
+
2. Add the relevant board configuration in managed_components->gmf_app_utils->Kconfig.projbuild.
33
+
3. Select the custom board in menuconfig->GMF APP Configuration → Target Board.
34
+
4. Add the relevant configuration in main->board_config.h.
35
+
> **Note:** If using a custom development board, it is recommended to copy the `tempotian__codec_board` and `espressif__gmf_app_utils` folders to the `components` directory
33
36
34
-
- Currently, upstream data uses the PCM format, while downstream data is encoded in Opus. More audio codecs will be supported in future updates.
37
+
### Software Preparation
38
+
39
+
- Configure WiFi information in menuconfig->Example Connection Configuration
40
+
- Fill in the applied `Access token` and `BOT ID` information in menuconfig->Example Audio Configuration
41
+
42
+
43
+
### About Encoding Formats
44
+
45
+
- Currently supported audio codec formats include OPUS, G711A, G711U, and PCM. For more information on supported codec formats, please refer to the [Coze official documentation](https://www.coze.cn/open/docs/developer_guides/streaming_chat_event).
35
46
36
47
### Operation Modes
37
48
@@ -59,29 +70,6 @@ The support of each operation mode across different chips is as follows:
59
70
60
71
**Note 1:** Planned to be supported in future versions
61
72
62
-
When using different modes, you need to adjust corresponding parameters in
63
-
`Component config → ESP Audio Simple Player`.
64
-
1.When using key press mode, the audio input and output are configured as 16-bit, mono. The configuration is as follows:
65
-
66
-
```text
67
-
CONFIG_AUDIO_SIMPLE_PLAYER_CH_CVT_DEST=1
68
-
CONFIG_AUDIO_SIMPLE_PLAYER_BIT_CVT_DEST_16BIT=y
69
-
```
70
-
71
-
2.When using a single ES8311 for both input and output, and enabling functions such as echo cancellation, the audio input and output are configured as 16-bit, stereo. The configuration is as follows:
72
-
73
-
```text
74
-
CONFIG_AUDIO_SIMPLE_PLAYER_CH_CVT_DEST=2
75
-
CONFIG_AUDIO_SIMPLE_PLAYER_BIT_CVT_DEST_16BIT=y
76
-
```
77
-
78
-
3.When using ES8311 for audio output and ES7210 for input, the audio input and output are configured as 32-bit, stereo. The configuration is as follows (default mode):
79
-
80
-
```text
81
-
CONFIG_AUDIO_SIMPLE_PLAYER_CH_CVT_DEST=2
82
-
CONFIG_AUDIO_SIMPLE_PLAYER_BIT_CVT_DEST_32BIT=y
83
-
```
84
-
85
73
### Configuration Steps
86
74
87
75
1. Enter the obtained Access Token and BOT ID in `Menuconfig -> Example Configuration`. The `Access Token` typically starts with `pat_`.
@@ -349,9 +337,59 @@ I (8397) ESP_GMF_TASK: One times job is complete, del[wk:0x3c728b54,ctx:0x3c71ff
349
337
I (8407) ESP_GMF_PORT: ACQ IN, new self payload:0x3c728b54, port:0x3c72f554, el:0x3c71ffe8-aud_simp_dec
350
338
I (8527) ESP_GMF_PORT: ACQ OUT, new self payload:0x3c720374, port:0x3c2ec964, el:0x3c2ec864-gmf_afe
351
339
```
340
+
## Troubleshooting
352
341
353
-
## Planned Features
342
+
### Self-Questioning Phenomenon
343
+
344
+
**Problem Description:**
345
+
346
+
The device exhibits a "self-questioning" phenomenon, where the audio played by the device is picked up again by the microphone and recognized, causing the system to be falsely triggered.
347
+
348
+
**Cause:**
349
+
350
+
Different hardware platforms use different models of microphones and speakers, and the physical distance between the microphone and speaker also varies. These hardware differences may cause the audio capture data to have too much or too little gain, which affects the performance of the Acoustic Echo Cancellation (AEC) algorithm.
354
351
355
-
1.Support for Opus encoding and audio transmission to the server
352
+
**Solution:**
353
+
354
+
This issue can be resolved by adjusting the audio gain parameters:
355
+
356
+
- Appropriately modify the values of [DEFAULT_RECORD_DB](./main/audio_processor.c#L70), [DEFAULT_RECOPRD_REF_DB](./main/audio_processor.c#L71), and [DEFAULT_PLAYBACK_VOLUME](./main/audio_processor.c#L70)
357
+
- Enable the `menuconfig->Example Audio Configuration->Enable AEC Debug` option to save recording data to storage for analysis
358
+
359
+
> **Note:** Enabling the AEC Debug feature requires that the hardware device is equipped with an SD card.
360
+
361
+
### Audio Data Send Timeout
362
+
363
+
**Problem Description:**
364
+
365
+
The system log shows the error message `Audio data send timeout`.
366
+
367
+
**Cause:**
368
+
369
+
This problem is usually caused by poor network connection quality, resulting in data packets not being sent to the server properly.
370
+
371
+
**Solution:**
372
+
373
+
- Improve the network connection quality in the current test environment
374
+
- Adjust the audio encoding method to reduce data transmission volume
375
+
376
+
> **Note:** According to tests, occasional `Audio data send timeout` errors do not affect the normal use of the voice recognition function.
377
+
378
+
### Multiple Modules Sharing the I2C Bus
379
+
380
+
**Problem Description:**
381
+
382
+
When other modules (such as LCD, touch screen, etc.) also need to use the I2C bus, abnormal phenomena may occur, such as unresponsive touch.
383
+
384
+
**Cause Analysis:**
385
+
386
+
By default, `audio_processor` will initialize the I2C bus and hold the I2C handle. If other modules also initialize or operate the same I2C bus, it may cause handle conflicts or resource contention.
387
+
388
+
**Recommended Solution:**
389
+
390
+
- If the I2C bus has already been initialized before `audio_processor` initialization, you can directly pass the existing I2C handle (`I2C_master_handle`) in [codec_info](./main/audio_processor.c#L71).
391
+
- If you need to access I2C after `audio_processor` initialization, you can obtain the initialized I2C handle via `esp_gmf_app_get_i2c_handle()` to avoid repeated initialization and conflicts.
392
+
393
+
## Planned Features
356
394
357
-
2.Support for multiple functional modes, such as enabling the speaker to perform mixing functionalities
395
+
1.Support for multiple functional forms, such as enabling mixing functions for speaker devices.
0 commit comments