Page 1 of 1

怎么通过i2s_read_bytes()函数读取mic数据啊?

Posted: Wed Dec 05, 2018 3:49 am
by xiaoseyihe
怎么通过i2s_read_bytes()函数读取mic数据啊?需要配置什么参数吗?
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,

.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,
};

Re: 怎么通过i2s_read_bytes()函数读取mic数据啊?

Posted: Wed Dec 05, 2018 8:02 pm
by brp80000
Can you use english?

How to use function i2s_read_bytes() to read mic data?

Posted: Thu Dec 06, 2018 1:25 am
by xiaoseyihe
Thank you for your advice。

How to use function i2s_read_bytes() to read mic data?
The I2S configuration is as follows. but, I cann't get the mic data.

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,

.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,
};

Re: 怎么通过i2s_read_bytes()函数读取mic数据啊?

Posted: Thu Dec 06, 2018 2:18 am
by ESP_Sprite
Looks good, at first glance at least. Could you elaborate on 'cannot get the mic data'? What data do you get?

Re: 怎么通过i2s_read_bytes()函数读取mic数据啊?

Posted: Thu Dec 06, 2018 2:37 am
by xiaoseyihe
I'm not sure. It's like noise, not the mic data

Re: 怎么通过i2s_read_bytes()函数读取mic数据啊?

Posted: Fri Dec 07, 2018 2:03 am
by ESP_Sprite
Any chance you can play a sample (100Hz sine wave or so) into the microphone and dump some of the data you get back? Perhaps it's as simple as a timing issue or something.