Search found 4 matches

by mike84
Thu Jun 24, 2021 12:41 pm
Forum: ESP-ADF
Topic: Custom Audio Element Problem
Replies: 6
Views: 10571

Re: Custom Audio Element Problem

Hello, I think your approach is not real-time. In the loop function, you first call `i2s_read_bytes` then wait 6 ms, then you send them to i2s output, and then, again you read the next batch. The latter batch you read is 6 ms late. I don't know Arduino-style coding on esp32 but there should be a me...
by mike84
Wed Jun 23, 2021 7:54 am
Forum: ESP-ADF
Topic: Custom Audio Element Problem
Replies: 6
Views: 10571

Re: Custom Audio Element Problem

Ok, the problem is caused by `uint16_t`. Converting it to `int16_t` solved the problem. Here is the corrected part: static int el_process(audio_element_handle_t self, char *buf, int len) { int rsize = audio_element_input(self, buf, len); if (len != rsize || (rsize % 4) != 0) { ESP_LOGW(TAG, "unexpe...
by mike84
Thu Jun 10, 2021 11:30 am
Forum: ESP-IDF
Topic: I2S microphone (RX)
Replies: 60
Views: 137454

Re: I2S microphone (RX)

Hi friends! I have modified my code. It works well now. The sound from the MEMS microphone via the I2S_NUM_0 I2S interface goes to the ESP32 and immediately to the output via I2S_NUM_0 I2S to the DAC PCM5102A. Now I want to try processing my sound. This will take time. If I insert a delay of 6-8 ms ...
by mike84
Sat Jun 05, 2021 9:27 am
Forum: ESP-IDF
Topic: I2S microphone (RX)
Replies: 60
Views: 137454

Re: I2S microphone (RX)

Here is a complete example, I verified it works: /* * app_main.c * * Created on: 30.03.2017 * Author: michaelboeckling */ #include <stdlib.h> #include <stddef.h> #include <inttypes.h> #include <string.h> #include <stdio.h> #include <stdbool.h> #include <sys/time.h> #include "freertos/FreeRTOS.h" #i...