[ESP32-Audio-Kit音频开发板测评]之四MIC输入探坑+求助
[复制链接]
本帖最后由 wo4fisher 于 2021-9-28 16:15 编辑
在完成了上一篇内容“play-mp3-control”例程内容之后,本以为接下来的旅程会顺利很多,然而并没有。因此这里是一篇求助帖。
网上有关ESP_ADF框架的经验分享不是很多,同时大多分享的也是一些步骤分享,并没有对框架等内容进行深层次的解析。仅有的一些文章主要涉及两个内容,一个是dueros的使用,另一个是ESP32语音识别,这两个都需要使用mic输入。
1、dueros操作
1.1 首先复制esp-adf\examples\dueros目录下的文件到新的文件夹。
1.2 然后是menuconfig中设置wifi的ssid和psw。
在vscode中进入menuconfig的办法有两个:1)ctrl+shift+p;2)安装expressif插件后vscond底部左边的设置图标。
1.3 在百度dueros开放平台注册账号,并进行开发者认真。认证之后,申请profile并下载。下载之后,解压其中一个文件替换掉esp-adf\components\dueros_service中的duer_profile文件,并将新文件名更改为duer_profile。
1.4 将触摸按键相关的内容注释掉,触摸按键占用cpu时间较多,会影响语音识别率
具体可参考下文链接【安信可ESP32语音开发板专题②】ESP32-Audio-Kit 开发板适配百度dueros例程实现在线语音功能,与开发板对话聊天。
1.4 build
1.5 load and run
1.5 问题
按照官方的readme文件
## Supported Features
- 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
应该会有如上的效果,事实上在使用的时候,板子上电初始化,连接wifi成功。
I (5245,tid:3ffdfd40) lightduer_engine.c( 242):duer_engine_start, g_handler:3F80B7B0, length:1469, profile:3F80D8C0
[0;33mW (6724) DUEROS: duer_callback: type:0, source:0x3f804eb4 data:2, data_len:0[0m
I (5255,tid:3ffdfd40) lightduer_ca_conf.c( 38): duer_conf_get_string: uuid = 21880000000001
I (5270,tid:3ffdfd40) lightduer_ca_conf.c( 38): duer_conf_get_string: serverAddr = device.iot.baidu.com
I (5327,tid:3ffdfd40) baidu_ca_socket_adp.c( 136):DNS lookup succeeded. IP=163.177.151.84
I (5385,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
W (5385,tid:3ffdfd40) lightduer_events.c( 80):[lightduer_ca] <== event end = 4012A740, timespent = 140
I (6512,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
W (6513,tid:3ffdfd40) lightduer_events.c( 80):[lightduer_ca] <== event end = 4012A8F8, timespent = 1031
I (6520,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6529,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6539,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6546,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6554,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6562,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6571,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6578,tid:3ffdfd40) lightduer_engine.c( 242):duer_engine_start, g_handler:3F80B7B0, length:0, profile:00000000
I (6589,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6659,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6663,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6666,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6675,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6683,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6692,tid:3ffdfd40) lightduer_connagent.c( 206):will start latter(DUER_ERR_TRANS_WOULD_BLOCK)
I (6962,tid:3ffdfd40) lightduer_voice.c( 716):Mutex initializing
I (6962,tid:3ffdfd40) lightduer_connagent.c( 187):connect started!
I (6964,tid:3ffdfd40) lightduer_ds_log_cache.c( 85):no cache report
[0;31mE (8448) DUEROS: event: 0[0m
[0;32mI (8451) DUEROS: duer_dcs_init[0m
I (6977,tid:3ffdfd40) lightduer_dcs_router.c( 305):namespace: ai.dueros.private.protocol
I (6984,tid:3ffdfd40) lightduer_dcs_router.c( 305):namespace: ai.dueros.device_interface.screen_extended_card
I (6993,tid:3ffdfd40) lightduer_dcs_router.c( 305):namespace: ai.dueros.device_interface.screen
I (7002,tid:3ffdfd40) lightduer_dcs_router.c( 305):namespace: ai.dueros.device_interface.system
I (7011,tid:3ffdfd40) lightduer_dcs_router.c( 305):namespace: ai.dueros.device_interface.voice_input
I (7019,tid:3ffdfd40) lightduer_dcs_router.c( 305):namespace: ai.dueros.device_interface.voice_output
I (7028,tid:3ffdfd40) lightduer_dcs_router.c( 305):namespace: ai.dueros.device_interface.speaker_controller
I (7038,tid:3ffdfd40) lightduer_dcs_router.c( 305):namespace: ai.dueros.device_interface.audio_player
[0;32mI (8528) AUDIO_WRAPPER: duer_dcs_get_speaker_state[0m
[0;32mI (8535) DUEROS: Dueros DUER_CMD_CONNECTED, duer_state:2[0m
[0;31mE (8535) DUEROS: event: DUER_EVENT_STARTED[0m
[0;33mW (8537) DUEROS: duer_callback: type:0, source:0x3f804eb4 data:3, data_len:0[0m
W (7063,tid:3ffdfd40) lightduer_events.c( 80):[lightduer_ca] <== event end = 4012A8F8, timespent = 106
I (7080,tid:3ffdfd40) lightduer_connagent.c( 220):add resource successfully!!
I (7087,tid:3ffdfd40) lightduer_connagent.c( 220):add resource successfully!!
W (7093,tid:3ffdfd40) lightduer_engine.c( 697):data cache has not sent, pending..., dcache_len:2, qcache_len:3
W (7106,tid:3ffdfd40) lightduer_system_info.c( 306):Undefined memory type, 0
E (7110,tid:3ffdfd40) lightduer_system_info.c( 389):Sys Info: Get disk info failed
W (7123,tid:3ffdfd40) lightduer_engine.c( 697):data cache has not sent, pending..., dcache_len:2, qcache_len:4
W (7134,tid:3ffdfd40) lightduer_engine.c( 697):data cache has not sent, pending..., dcache_len:2, qcache_len:3
W (7140,tid:3ffdfd40) lightduer_engine.c( 697):data cache has not sent, pending..., dcache_len:2, qcache_len:2
W (7150,tid:3ffdfd40) lightduer_engine.c( 697):data cache has not sent, pending..., dcache_len:2, qcache_len:1
I (7383,tid:3ffdfd40) lightduer_dcs_router.c( 459):Directive name: ThrowException
E (7383,tid:3ffdfd40) lightduer_dcs_system.c( 314):error code: INVALID_REQUEST_EXCEPTION
E (7387,tid:3ffdfd40) lightduer_dcs_system.c( 315):error: didp product not exsists
I (7401,tid:3ffdfd40) lightduer_dcs_router.c( 459):Directive name: ThrowException
E (7403,tid:3ffdfd40) lightduer_dcs_system.c( 314):error code: INVALID_REQUEST_EXCEPTION
E (7410,tid:3ffdfd40) lightduer_dcs_system.c( 315):error: didp product not exsists
I (7422,tid:3ffdfd40) lightduer_dcs_router.c( 459):Directive name: DialogueFinished
I (7435,tid:3ffdfd40) lightduer_dcs_router.c( 459):Directive name: DialogueFinished
W (7449,tid:3ffdfd40) lightduer_engine.c( 697):data cache has not sent, pending..., dcache_len:2, qcache_len:2
W (7454,tid:3ffdfd40) lightduer_engine.c( 697):data cache has not sent, pending..., dcache_len:2, qcache_len:1
日志显示有一些error信息。
目前已知,可以播放sdcard中的音频文件,正确连接wifi,还需要进一步研究。@安信可,@乐鑫
2 esp-adf\examples\speech_recognition\asr
该例程为语音识别例程,为了测试是否是mic输入的问题,这里进一步测试了asr例程。本例程主要有关键词“嗨,乐鑫”为唤醒词,另外就是有一些预设的命令语音。
在经过menuconfig和build之后,下载到板子依然是没有任何反应。
3 esp-adf\examples\recorder\pipeline_recording_to_sdcard
进一步测试了pipeline_recording_to_sdcard例程,本例程是运行后,默认录音10s,然后将录音文件保存在sdcard中,文件名为rec.wav。
下图为录制后的音频文件,一马平川,没有任何波澜。
至此,可以断定,是mic语音输入的问题。
|