乐鑫官方开发板只有LyraT 使用了eso8388, 但是AUDIO_ADC_INPUT_CH_FORMAT “N”, AFE算法不接受N参数。
···
ESP_LOGI(TAG, "[ 1 ] Start codec chip");
board_handle = audio_board_init();
audio_hal_ctrl_codec(board_handle->audio_hal, AUDIO_HAL_CODEC_MODE_BOTH, AUDIO_HAL_CTRL_START);
// es8388_set_mic_gain(MIC_GAIN_24DB);
ESP_LOGI(TAG, "[ 2 ] Create audio pipeline for recording");
audio_pipeline_cfg_t pipeline_cfg = DEFAULT_AUDIO_PIPELINE_CONFIG();
pipeline = audio_pipeline_init(&pipeline_cfg);
mem_assert(pipeline);
ESP_LOGI(TAG, "[2.1] Create i2s stream to read audio data from codec chip");
i2s_stream_cfg_t i2s_cfg = I2S_STREAM_CFG_DEFAULT_WITH_PARA(CODEC_ADC_I2S_PORT, 48000, 16, AUDIO_STREAM_READER);
i2s_stream_reader = i2s_stream_init(&i2s_cfg);
ESP_LOGI(TAG, "[2.2] Create filter to resample audio data");
rsp_filter_cfg_t rsp_cfg = DEFAULT_RESAMPLE_FILTER_CONFIG();
rsp_cfg.src_rate = 48000;
rsp_cfg.src_ch = 2;
rsp_cfg.dest_rate = sample_rate;
rsp_cfg.dest_ch = 2;
dst_channel = 2;
filter = rsp_filter_init(&rsp_cfg);
ESP_LOGI(TAG, "[2.3] Create raw to receive data");
raw_stream_cfg_t raw_cfg = {
.out_rb_size = 8 * 1024,
.type = AUDIO_STREAM_READER,
};
raw_read = raw_stream_init(&raw_cfg);
ESP_LOGI(TAG, "[ 3 ] Register all elements to audio pipeline");
audio_pipeline_register(pipeline, i2s_stream_reader, "i2s");
audio_pipeline_register(pipeline, filter, "filter");
audio_pipeline_register(pipeline, raw_read, "raw");
ESP_LOGI(TAG, "[ 4 ] Link elements together [codec_chip]-->i2s_stream-->filter-->raw-->[VAD]");
const char *link_tag[3] = {"i2s", "filter", "raw"};
audio_pipeline_link(pipeline, &link_tag[0], 3);
ESP_LOGI(TAG, "[ 5 ] Start audio_pipeline");
audio_pipeline_run(pipeline);
···
当使用以上代码初始化音频,
使用以下代码读取数据
int read_len = raw_stream_read(raw_read, (char *)buffer, buffer_len);
afe_handle->feed(afe_data, buffer);
如何判断使用的AUDIO_ADC_INPUT_CH_FORMAT?
音频芯片:es8388 ,如何设置 AUDIO_ADC_INPUT_CH_FORMAT ?
-
fengxinan@eegion.com
- Posts: 1
- Joined: Mon Jul 07, 2025 9:07 am
Re: 音频芯片:es8388 ,如何设置 AUDIO_ADC_INPUT_CH_FORMAT ?
ES8388 好像不支持硬件回采,也就是说它并不支持硬件回采后的 AEC , 只能支持软件回采也就是这里说的 https://github.com/espressif/esp-adf/bl ... m_stream.h type1、type2 的区别
如果您需要软件回采,得参考这里说明配置一下才可以
ps: 对于算法而言,硬件回采效果要优于软件回采效果;如果需要双入双出的话可以考虑 ES8389
如果您需要软件回采,得参考这里说明配置一下才可以
ps: 对于算法而言,硬件回采效果要优于软件回采效果;如果需要双入双出的话可以考虑 ES8389
Who is online
Users browsing this forum: No registered users and 1 guest
