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

xiaoseyihe
Posts: 9
Joined: Thu Sep 06, 2018 6:04 am

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

Postby xiaoseyihe » Wed Dec 05, 2018 3:49 am

怎么通过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,
};

User avatar
brp80000
Posts: 138
Joined: Thu Oct 04, 2018 7:13 pm

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

Postby brp80000 » Wed Dec 05, 2018 8:02 pm

Can you use english?

xiaoseyihe
Posts: 9
Joined: Thu Sep 06, 2018 6:04 am

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

Postby xiaoseyihe » Thu Dec 06, 2018 1:25 am

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

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Thu Dec 06, 2018 2:18 am

Looks good, at first glance at least. Could you elaborate on 'cannot get the mic data'? What data do you get?

xiaoseyihe
Posts: 9
Joined: Thu Sep 06, 2018 6:04 am

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

Postby xiaoseyihe » Thu Dec 06, 2018 2:37 am

I'm not sure. It's like noise, not the mic data

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Fri Dec 07, 2018 2:03 am

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.

Who is online

Users browsing this forum: Bing [Bot], Gaston1980 and 132 guests