AnsweredAssumed Answered

Problem in Simultaneous Record and Play

Question asked by gupta.n on Sep 11, 2015
Hi,

  I'm trying to write an application to do simultaneous record and play on the STM32F4Discovery board. (16 KHz, 2 Channel, 16-bits). The audio quality on the speaker is not good in this case.

  Thereafter, I tried to do this sequentially instead of simultaneously. I first record into a 40960 bytes buffer and then play from that buffer. The sequence is:

BSP_AUDIO_IN_Init()
BSP_AUDIO_IN_Record()

// Record Samples

BSP_AUDIO_IN_Stop()

BSP_AUDIO_OUT_Init()
BSP_AUDIO_OUT_Play()

// Play the same buffer

BSP_AUDIO_OUT_Stop()

  This sequence runs correctly for the first time and I'm able to hear the recorded audio correctly. But when I run this in a loop for the second time, the audio is highly distorted. I can barely make out what was spoken during recording.

  Could you please advise on anything that I might be doing wrong.

thanks,
Ngupta

Outcomes