[Asterisk-Dev] Error in Translation
Syed Amin
obaidasyed at yahoo.com
Fri Jul 30 02:52:59 MST 2004
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20040730/7522e6f8/attachment.htm
More information about the asterisk-dev
mailing list