Skip to main content
Ander Susperregui
Associate II
January 19, 2022
Question

Audio from microphone through headphones

  • January 19, 2022
  • 1 reply
  • 3142 views

I am using a STM32G0C1E-EV board to try to get data from my microphone through the ADC and hear it in real time on my headphones via DAC. I have used a timer in order to get data in 16000 Hz format and I have used DMA circular buffers to get and transmit the data from the ADC to the DAC. The problem is that I only listen noise being outputted even though the data is getting through properly. I am wondering if the configuration I made for the ADC and DMA/Timer is properly done. I am posting the code in case somebody sees the problem.

Thank you in advance.

This topic has been closed for replies.

1 reply

Javier1
Principal
January 19, 2022

I didnt look at your code but:, make sure your ADC readings are properly casted to wat the DAC needs.

 Dont try to stick a uint16 inside a uint8 and make sure the ADC readings are correctly aligned.

Could you show us what comes out of the DAC if you read a pure sine wave with the ADC?

hit me up in https://www.linkedin.com/in/javiermuñoz/
Ander Susperregui
Associate II
January 19, 2022

Thanks for the fast replay,

How can I introduce a sine wave in the ADC if I im reading through the jack of the board in order to get the microphone data? Or should I change the ADC pin and introduce the sine wave through a pin?

Javier1
Principal
January 19, 2022

Maybe you could connect your Pc headphones output to your ev board (male jack to male jack cable) and play sine waves with this https://www.szynalski.com/tone-generator/

*its a very expensive EV board thats why i didnt advised you to start soldering wires to the ADC

hit me up in https://www.linkedin.com/in/javiermuñoz/