Do we have a manageable way to up-stream audio?

I have this MIC chip works quite well with the TMRpcm library for recording to a SD card, what I am trying to do here is do up-stream live audio via an ESP32 or 8266's wifi, and receive the stream on a browser or other forms of client.

The main problem I'm having now is that I'm not sure what approach to use to convert analog audio input from the mic chip to digital data chuck ready for send. I didn't find any lib that can do it directly, I was thinking maybe I can modify the TMRpcm lib a bit to let it store the data in a variable instead of saving to SD card? Or, considering limited ram and buffer issue, should I just let it write to sd card continuously in one thread and read from the sd card and send them in another thread? I haven't check if the sd card lib would allow async operation of reading and writing at the same time yet...

This seems a little complicated to me, am I thinking in a wrong direction? Is there any more manageable way to make this work? Thanks!

How is TMRpcm relevant if you have an ESP32 with a full-blown DMA-enabled I²S interface?

Pieter

The plan A is to use an analog mic and do ADC instead of a i2s, would i2s be much easier?

The ESP32 has a built-in I2S ADC (and DAC): https://github.com/espressif/esp-idf/tree/master/examples/peripherals/i2s_adc_dac

This could be useful as well: esp-adf/examples/recorder/pipeline_raw_http at master · espressif/esp-adf · GitHub