[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    [Asterisk-Dev] Error in Translation
From:       Syed Amin <obaidasyed () yahoo ! com>
Date:       2004-07-30 9:52:59
Message-ID: 20040730095259.53129.qmail () web53505 ! mail ! yahoo ! com
[Download RAW message or body]

For asterisk-0.4.0 i made an application which merges a wav file with telephonic \
conversation to have background music while u talking with some one.For this what i \
did 

1. Set translation paths
        ch1->readformat=AST_FORMAT_SLINEAR;
        ch1->writeformat=ch1->nativeformats;

        ch2->readformat=AST_FORMAT_SLINEAR;
        ch2->writeformat=ch2->nativeformats;

        ch1->pvt->readtrans=ast_translator_build_path(ch1->readformat, \
                ch1->nativeformats);
        ch1->pvt->writetrans=ast_translator_build_path(ch1->nativeformats, \
ch1->readformat);

        ch2->pvt->writetrans=ast_translator_build_path(ch2->nativeformats, \
                ch1->readformat);
        ch2->pvt->readtrans=ast_translator_build_path(ch2->nativeformats, \
ch1->readformat);  2: Then i read frames from both channel using 
fr1=ast_read(ch1)and fr2=ast_read(ch2)
 and get a file from stream like this.
      s1=ast_openstream(ch1,"test2",ch1-> language);
      ast_applystream(ch1,s1);
      fr = ast_readframe(s1);

3:Merges fr1 and fr to fr3 and send it to Ch2 via ast_write(ch2,fr3)
4:Merges fr2 and fr  to fr3 and send it to Ch1 via ast_write(ch1,fr3)

It worked perfectly fine .


But Now with latest CVS it isnt working as i updated my Asterisk after a long \
time.What i m ahving rite now its garbaged Sound which seems to me "Short Writes".

Any Help that what changes should be made to make it work.

 
Syed Obaid Amin
 



		
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.


[Attachment #3 (text/html)]

<DIV>
<DIV>For asterisk-0.4.0 i made an application which merges a wav file with telephonic \
conversation to have background music while u talking with some one.For this what i \
did <BR><BR>1. Set translation \
paths<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch1-&gt;readformat=AST_FORMAT \
_SLINEAR;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch1-&gt;writeformat=ch1-& \
gt;nativeformats;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch2-&gt;readf \
ormat=AST_FORMAT_SLINEAR;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch2-&gt;w \
riteformat=ch2-&gt;nativeformats;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch1-&gt;pvt-&gt;readtrans=ast_translator_build_path(ch1-&gt;readformat, \
ch1-&gt;nativeformats);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch1-&gt;pvt-&gt;writetrans=ast_translator_build_path(ch1-&gt;nativeformats,
  ch1-&gt;readformat);<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch2-&gt;pvt-&gt;writetrans=ast_translator_build_path(ch2-&gt;nativeformats, \
ch1-&gt;readformat);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch2-&gt;pvt-&gt;readtrans=ast_translator_build_path(ch2-&gt;nativeformats, \
ch1-&gt;readformat);<BR>&nbsp;2: Then i read frames from both channel using \
<BR>fr1=ast_read(ch1)and fr2=ast_read(ch2)<BR>&nbsp;and get a file from stream like \
this.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s1=ast_openstream(ch1,"test2",ch1-&gt; \
language);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ast_applystream(ch1,s1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fr \
= ast_readframe(s1);<BR><BR>3:Merges fr1 and fr to fr3 and send it to Ch2 via \
ast_write(ch2,fr3)<BR>4:Merges fr2 and fr&nbsp; to fr3 and send it to Ch1 via \
ast_write(ch1,fr3)<BR><BR>It worked perfectly fine .<BR><BR><BR>But Now with latest \
CVS it isnt working as i updated my Asterisk after a long time.What i m ahving rite \
now its  garbaged Sound which seems to me "Short Writes".<BR><BR>Any Help that what \
changes should be made to make it work.<BR></DIV> <DIV>&nbsp;</DIV>
<DIV>Syed Obaid Amin</DIV>
<DIV>&nbsp;</DIV><BR></DIV><p>
		<hr size=1>Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/aac/*http://promotions.yahoo.com/new_mail/static/ease.html">Yahoo! \
Mail Address AutoComplete</a> - You start. We finish.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic