@晕哥,我就是用cooledit 和 audacity打开的,采集的数据都是杂音。
I2S配置如下:
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_TX,
.sample_rate = 48000,
.bits_per_sample = SUPPOERTED_BITS,
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_I2S,
//when dma_buf_count = 3 and dma_buf_len = 300, then 3 * 4 * 300 * 2 Bytes internal RAM will be used. The multiplier 2 is for Rx buffer and Tx buffer together.
.dma_buf_count = 3, /*!< amount of the dam buffer sectors*/
.dma_buf_len = 300, /*!< dam buffer size of each sector (word, i.e. 4 Bytes) */
.intr_alloc_flags = I2S_INTER_FLAG,
.use_apll = 1,
};
duros 录音采集到一路数据,怎么能够采集两个mic的数据呢? 目前录音保存的是rec_engine_data_read(voiceData, ONE_FRAM_SIZE, 110 / portTICK_PERIOD_MS);中voiceData的数据,只有一路,这个数据是怎么得到呢?有清楚的吗? 通过下面配置推断,原始数据是2路,经过重采样后变成1路,猜想就是voiceData的数据。
i2s_stream_cfg_t i2s_cfg = I2S_STREAM_CFG_DEFAULT();
i2s_cfg.type = AUDIO_STREAM_READER;
i2s_stream_reader = i2s_stream_init(&i2s_cfg);
audio_element_info_t i2s_info = {0};
audio_element_getinfo(i2s_stream_reader, &i2s_info);
i2s_info.bits = 16;
i2s_info.channels = 2;
i2s_info.sample_rates = 48000;
audio_element_setinfo(i2s_stream_reader, &i2s_info);
rsp_filter_cfg_t rsp_cfg = DEFAULT_RESAMPLE_FILTER_CONFIG();
rsp_cfg.src_rate = 48000;
rsp_cfg.src_ch = 2;
rsp_cfg.dest_rate = 16000;
rsp_cfg.dest_ch = 1;
//rsp_cfg.dest_ch = 2;
rsp_cfg.type = AUDIO_CODEC_TYPE_ENCODER;
audio_element_handle_t filter = rsp_filter_init(&rsp_cfg);
@晕哥 感谢指导,刚测试了上面的用例,报出挂载文件系统 错误,你遇到过这个问题吗?
(217) boot: Disabling RNG early entropy source...
I (222) cpu_start: Pro cpu up.
I (226) cpu_start: Starting app cpu, entry point is 0x40080ecc
I (0) cpu_start: App cpu up.
I (236) heap_init: Initializing. RAM available for dynamic allocation:
I (243) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (249) heap_init: At 3FFB3278 len 0002CD88 (179 KiB): DRAM
I (256) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (262) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (268) heap_init: At 40089B5C len 000164A4 (89 KiB): IRAM
I (275) cpu_start: Pro cpu start user code
I (293) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (294) example: Initializing SD card
I (294) example: Using SDMMC peripheral
I (294) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
E (334) sdmmc_sd: sdmmc_check_scr: send_scr returned 0xffffffff
E (334) example: Failed to mount filesystem. If you want the card to be formatted, set format_if_mount_failed = true.
格式化了,也不行,需要配置什么吗?我是在duero用例中创建的,看到ESP-ADF中有其他地方在使用fopen("/sdcard/**.wav", "w+");方式,
rec_config_t eng = DEFAULT_REC_ENGINE_CONFIG();
eng.evt_cb = rec_engine_cb;
eng.open = recorder_pipeline_open;
eng.close = recorder_pipeline_close;
eng.fetch = recorder_pipeline_read;
rec_engine_create(&eng);
int retry_time = 1000 / portTICK_PERIOD_MS;
int retry_num = 1;
retry_login_timer = xTimerCreate("tm_duer_login", retry_time,
pdFALSE, NULL, retry_login_timer_cb);
FILE *file = NULL;
//#if RECORD_DEBUG
#if 1
file = fopen("/sdcard/rec_debug_1.wav", "w+");
if (NULL == file) {
//ESP_AUDIO_LOGW(TAG, "open rec_debug_1.wav failed,[%d]", __LINE__);
ESP_LOGE(TAG, "open rec_debug_1.wav failed,[%d]", __LINE__);
}
else
{
ESP_LOGE(TAG, "open rec_debug_1.wav Success,[%d]", __LINE__);
}