0
0

I am recording the sound and send to loopback ( 127.0.0.1 ) ,at same time get and save the file this raw sound data. There is no problem. But when I tried to play this file at a same time with same data I can heard lots of noise or silences . I send code . Thanks you for all helps

void *dogrusalSes = malloc ( SES_TAMPON_BOYUTU );
int indeksDogrusalSes = 0;

while ( 1 )
{
unsigned len1 , len2;

//Lock sample
FSOUND_Sample_Lock( samp ,
0 ,
BOYUT ,
&ptr1,
&ptr2,
&len1,
&len2);

int gelenBoyut ;
gelenBoyut = 10000;
void *sesVerisi;

sesVerisi = gelenTampon.veriOku( &gelenBoyut );

// This process write a CORRECT data to file
vav.write( (char *) sesVerisi , gelenBoyut );

memcpy ( (char *) dogrusalSes + indeksDogrusalSes ,
(char *) sesVerisi ,
gelenBoyut );

indeksDogrusalSes += gelenBoyut;

if ( indeksDogrusalSes + 200000 >= SES_TAMPON_BOYUTU )
{

       int sss = FSOUND_Sample_Upload ( samp ,  
     dogrusalSes ,
         FSOUND_STEREO | FSOUND_16BITS |FSOUND_LOADMEMORY                   );

int channel = FSOUND_PlaySound(FSOUND_FREE , samp);

indeksDogrusalSes = 0;

}//end-if

free ( sesVerisi ) ;

FSOUND_Sample_Unlock( samp ,
&ptr1,
&ptr2,
len1,
len2);

}//while ( 1 )

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.