<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2> Hello..</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm trying to develop an application and I need to
mix 2 or more audio frames..</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>struct ast_frame *frame1;
<DIV><FONT face=Arial size=2>struct ast_frame *frame2;</FONT></DIV>
<DIV>struct ast_frame *frame3;</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Now , I want to put in frame3 the mixed content of frame1 and
frame2..</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>I managed to do that using this:</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>
unsigned char
*data1=(char*)malloc(frame1->datalen);<BR>
unsigned char
*data2=(char*)malloc(frame2->datalen);<BR>
memcpy(data1,frame1>data,frame1->datalen);<BR>
memcpy(data2,frame2->data,frame2->datalen);<BR>
for(kl1=0;kl1<user_chan_f->datalen;kl1++){<BR>
data1[kl1] = ( kl1 & 1 ? data1[kl1] : data2[kl1] );</DIV>
<DIV>
memcpy(frame3->data,data1,frame1->datalen);</DIV>
<DIV> </DIV>
<DIV>but the sound quality is not so good.. With a very little effort , you can
recognize the voices..</DIV>
<DIV> </DIV>
<DIV>Is there a better way to do this ?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV> Alex</DIV>
<DIV> </DIV>
<DIV> </DIV></FONT></DIV></BODY></HTML>