cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in stm32f4 Audio playback and recording ?!

sami
Associate II
Posted on April 25, 2013 at 12:11

Hello ;

In the recording example in teh discovery board we have this code :

if(Data_Status==1) 
{ 
Data_Status=0; 
/* Switch the buffers*/ 
if (Switch ==1) 
{ 
pAudioRecBuf = RecBuf; 
writebuffer = RecBuf1; 
WaveCounter += 32; 
Switch = 0; 
} 
else 
{ 
pAudioRecBuf = RecBuf1; 
writebuffer = RecBuf; 
WaveCounter += 32; 
Switch = 1; 
} 
for (counter=0; counter<16; counter++) 
{ 
if (buf_idx< RAM_BUFFER_SIZE) 
{ 
/* Store Data in RAM buffer */ 
RAM_Buf[buf_idx++]= *(writebuffer + counter); 
if (buf_idx1 == RAM_BUFFER_SIZE) 
{ 
buf_idx1 = 0; 
/* Write the stored data in the RAm to the USB Key */ 
f_write (&file, (uint16_t*)RAM_Buf1, RAM_BUFFER_SIZE*2 , (void *)&bytesWritten); 
} 
} 
else if (buf_idx1< RAM_BUFFER_SIZE) 
{ 
/* Store Data in RAM buffer */ 
RAM_Buf1[buf_idx1++]= *(writebuffer + counter); 
if (buf_idx == RAM_BUFFER_SIZE) 
{ 
buf_idx = 0; 
/* Write the stored data in the RAM to the USB Key */ 
f_write (&file, (uint16_t*)RAM_Buf, RAM_BUFFER_SIZE*2 , (void *)&bytesWritten); 
} 
} 
} 
} 
} 

I believe

RAM_Buf1

stores the wrong data and all the time

RAM_Buf only been used , Please check it 

 Regards 
 Esat

1 REPLY 1
rmccarthy
Associate
Posted on June 20, 2013 at 18:31

Hi, I have come across the same issue, did you have any luck with this?