cancel
Showing results for 
Search instead for 
Did you mean: 

Audio from microphone through headphones

Ander Susperregui
Associate III

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.

4 REPLIES 4
Javier1
Principal

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?

we dont need to firmware by ourselves, lets talk

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?

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

we dont need to firmware by ourselves, lets talk

I have connected my mobile phone to the ADC and sampled a sine wave into it. The values are the same the demonstration program fills into a .wav program, so it seems the ADC is working properly. However, I dont know how to send the data of the ADC to the DAC via DMA, when I try I only hear noise all the time.