0
\$\begingroup\$

I want to record audio (a human talking), store it on my microcontroller, and then be able to play it back through an amplifier. The recording doesn't need to be super high quality, just understandable. Preferably be able to store several different recordings at once, but I can start with one and work from there. I'm just very confused as to how to go about that.

So I have the MAX4466 datasheet here for audio input and the PAM8302 datasheet here for audio output. I have successfully played audio through the amp but only from a preset library. I have tried to follow a number of tutorials online, but I'm getting stuck at recording actual values using the MAX4466. The ESP32 built-in ADC measures a value of around 782 no matter what I do.

What I am hoping to get here is a kind of general description of how I'm supposed to going about this. Eg is using the MAX4466 with the ADC correct, how should I then store those values/how often should I read them, and then how do I output them to the PAM8302. I know there's a lot of details left out about what I specifically have tried - I am just picking this project up now after a few months off so I don't remember or have some details like my schematic or what my most recent code is. I can certainly dig that up and re-ask this, but I figured I'd start off like this and see if anyone had some guidance with me. Audio is super unfamiliar territory for me. Also, I'm super willing to get some different hardware if anyone has done this before.

\$\endgroup\$
2
  • \$\begingroup\$ on esp32 and esp8266 there is option for i2s protocol that may help. \$\endgroup\$
    – Chr_arj
    Jun 17, 2023 at 6:47
  • \$\begingroup\$ Neither you nor we can know what is wrong without a schematic of the circuit you are testing. And you should also measure the input at the ADC pin with an oscilloscope, to verify that the hardware part is correct \$\endgroup\$
    – Jon Nordby
    Jun 18, 2023 at 21:04

1 Answer 1

1
\$\begingroup\$

There are really several parts to your design, and you should address them separately:

  • amplifying a microphone to a suitable level for the ADC (and providing necessary filters etc)
  • sampling the analogue signal and storing it
  • replaying it through the DAC and amplifying it for a speaker

You can and should work on the second one with signals from some sort of signal generator to feed the ADC, and use a scope to check the output of the DAC. At this stage you should aim to verify that the converters at each end are working, and that you are saving and recalling the data correctly.

Once you have this working , worry about amplification for mic and speaker, but not before. Divide and conquer.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.