ESP32-cam + microphone

Hey to everyone.

Looking for some help with ESP32 camera module and how to add microphone support to it, for example if I want to stream not only video, is that possible?

hello..

did you find any answer? i'm searching the exact same thing..i want to record, not play audio files

Yes, you can find a good tutorial here: Guide for Microphone Sound Sensor Arduino | Random Nerd Tutorials

Cheers,

Bob

kagayaki:
Yes, you can find a good tutorial here: Guide for Microphone Sound Sensor Arduino | Random Nerd Tutorials

Cheers,

Bob

Thanks but AndreyZelenchuk (and me...) wanted to stream microphone capture, the link is about a sound detector, not streaming.

I just found an interesting video from the guy with the Swiss accent, he compare a few ESP32 boards and give some sketches for audio but only for TTGO board with digital mic onboard.

It seems to be possible to stream audio, but I haven't found video + audio streaming, maybe with RTSP protocol, but I'm not an expert.

If anybody found something, I'm interested of course.

AndreyZelenchuk didi you have something new ?

3 Likes

Hi! I'm looking into the same issue. Did you manage to do anything?

1 Like

look like someone did manage

using this

That video appears to be for a standatd ESP32 based module.

This thread is about the ESP32CAM module which has very few spare IO pins.

Have you checked that whats described in the video actually works on an ESP32CAM ?

I2S signals can be configured to use spare IO pins it seems.

I'm starting to work on this for the esp32-CAM

p.s. after a bit of checking, I ordered some INMP441 boards, they seem a better choice

1 Like

Hi! Did you manage to combine video from esp32cam with audio input?

not yet. 1st I am going to make an esp32 mic example work on esp32-cam. After that, there will be two options to test to use an I2S mic (needs 3 IOs) and video, either:

  • use GPIOs 0,1 and 3 (or 16) to keep using the SD card with four data lines but loosing the debug serial port,
  • or try to use GPIOs 4,12 and 13 to try using the SD card with only one data line and see if there is still enough bandwidth to save audio & video while keeping GPIOs 0,1 and 3 (or 16) for serial ports or something else.
    Also, I wonder if it would be feasable to use I2S with only two lines since this is not a stereo application...

I made the first option you mentioned with pins 0,1,3, wtih an INMP441. I followed this example https://www.youtube.com/watch?v=qmruNKeIN-o&t=254s&ab_channel=ThatProjectThatProject. My problem is, that I don't know how to combine this wav file with video from ESP32Cam.

looks like adding mp3 to mjpeg into an avi file is feasable, but I'm really not there yet, I've started coding but my mic has not arrived yet. You are ahead of me

Hi, I am trying to do the same thing! Do you know if it is possible to stream the audio and video at the same time instead of storing the files on the SD Card?

did you use the recorder only (PDM) example or the recorder&player (ADC) example?

I just record the sound with the INMP441 and I store the file into the SD Card. So, just PDM

I don't know what to say about it... but I think it can be possible if you stream video and audio at the same time. It is a matter for research

ok so if I understand AVI correctly, to have both video and sound, when building the file, we would need to add multiple PCM (or LPCM, they are the same a WAV file is made of) chunks between the JPEG chunks. To use compressed audio, MP3 might require a lot of processing, ADPCM would be much less intensive and would cut by half the amount of data needed by PCM. I haven't looked at the code where streaming is used, my priority is the SD card. I might have a look at the streaming code once it works on SD. I'm working to add audio to the following code:

I recommend you look over the junior version. It seems simpler to me. https://github.com/jameszah/ESP32-CAM-Video-Recorder-junior

The avi building code looks the same in both versions of jameszah's recorder.
I still didn't receive my mic yet. Are you able to send me a WAV file built with the ESP32 INMP441 Tutorial PDM example? I could do some AVI building tests. Even better, would you be able to send me a few seconds samples of PDM bytes in a binary file or an ASCII HEX text file?

I would like to help you but I really can't during this period. Why not use a wav sample?