<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
<style>BODY{font:10pt Tahoma, Verdana, sans-serif}</style></head><body>
<DIV>Dude, look very hard at your code. All the API commands you are using are Async. You start the file playing, and right away you stop it, and then hangup the channel "sesison.hangup()". </DIV>
<DIV>&nbsp;</DIV>
<DIV>Why are you stopping the displace right away. If you want the whole thing to keep going, till it's done, then don't stop it, and don't hangup the channel. Maybe you should change the "session.hangup" to "session.execute("park")? </DIV>
<DIV>&nbsp;</DIV>
<DIV>--Dave</DIV><BR>
<BLOCKQUOTE style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<HR>
<B>From:</B> Khue Nguyen Minh [mailto:khuenm@vega.com.vn]<BR><B>To:</B> FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org]<BR><B>Sent:</B> Tue, 30 Oct 2012 05:46:33 -0700<BR><B>Subject:</B> Re: [Freeswitch-users] How to mix audio in FreeSWITCH<BR><BR>Hi Michael,
<DIV><BR></DIV>
<DIV>I create a js script as follow:</DIV>
<DIV>session.answer()</DIV>
<DIV>while (session.ready())</DIV>
<DIV>{</DIV>
<BLOCKQUOTE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 40px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px">
<DIV>apiExecute("uuid_displace", session.uuid + " start /opt/freeswitch/sounds/welcome.wav 60 mux");</DIV>
<DIV>apiExecute("uuid_displae", session.uuid + " stop /opt/freeswitch/sounds/welcome.wav");</DIV>
<DIV>session.hangup()</DIV></BLOCKQUOTE>
<DIV>}</DIV>
<DIV><FONT face=sans-serif><SPAN style="LINE-HEIGHT: 19px">When I make a new call, script run normal but I do not see anything (the call hangup immediately) and I don't know How I can save "mux audio" to new file? Please guide me.</SPAN></FONT></DIV>
<DIV><FONT face=sans-serif><SPAN style="LINE-HEIGHT: 19px"><BR></SPAN></FONT></DIV>
<DIV><FONT face=sans-serif><SPAN style="LINE-HEIGHT: 19px">Brs,</SPAN></FONT></DIV>
<DIV><FONT face=sans-serif><SPAN style="LINE-HEIGHT: 19px">Khue<BR></SPAN></FONT><BR>
<DIV class=gmail_quote>2012/10/30 Michael Collins <SPAN>&lt;<A href="mailto:msc@freeswitch.org">msc@freeswitch.org</A>&gt;</SPAN><BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>You might also try uuid_displace API with the "mux" option, although I kind of like the idea of getting a group of uninhibited users all in a conference room singing "Love Shack" by the B52's.<BR>-MC
<DIV class=HOEnZb>
<DIV class=h5><BR><BR>
<DIV class=gmail_quote>On Sun, Oct 28, 2012 at 10:45 PM, SamyGo <SPAN>&lt;<A href="mailto:govoiper@gmail.com">govoiper@gmail.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>Hi,
<DIV><BR></DIV>
<DIV>You should try using "sox" if there is nothing you've found in freeswitch. Execute a system sox command and input the two recordings. Later the mixed audio can be played back to user.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Another approach can be to use a conference bridge in which a local channel and the incoming caller are bridged and the conference is recorded. The recorded conference can be played back or used as well.</DIV>
<DIV><BR></DIV>
<DIV>BR</DIV>
<DIV>Sammy</DIV>
<DIV><BR></DIV>
<DIV><BR>
<DIV class=gmail_quote>
<DIV>
<DIV>On Mon, Oct 29, 2012 at 8:46 AM, Khue Nguyen Minh <SPAN>&lt;<A href="mailto:khuenm@vega.com.vn">khuenm@vega.com.vn</A>&gt;</SPAN> wrote:<BR></DIV></DIV>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>
<DIV>
<DIV>Hi all,
<DIV><BR></DIV>
<DIV>I want create a js scripts to execute a simple karaoke application. When user make call to my system, js scripts will play a audio file and user can sing. The js scripts will record the song and mix it with audio that is playing. Now, I can create a js to play audio, record call but I don't know how I can mix audio. Please help me.</DIV>
<DIV><BR></DIV>
<DIV>Thanks &amp; Best regards,</DIV>
<DIV>Khue.</DIV><BR></DIV></DIV>_________________________________________________________________________<BR>Professional FreeSWITCH Consulting Services:<BR><A href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A><BR><A href="http://www.freeswitchsolutions.com/">http://www.freeswitchsolutions.com</A><BR><BR>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR><A href="http://www.cudatel.com/">http://www.cudatel.com</A><BR><BR>Official FreeSWITCH Sites<BR><A href="http://www.freeswitch.org/">http://www.freeswitch.org</A><BR><A href="http://wiki.freeswitch.org/">http://wiki.freeswitch.org</A><BR><A href="http://www.cluecon.com/">http://www.cluecon.com</A><BR><BR>FreeSWITCH-users mailing list<BR><A href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A><BR><A href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>UNSUBSCRIBE:<A href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR><A href="http://www.freeswitch.org/">http://www.freeswitch.org</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV><BR>_________________________________________________________________________<BR>Professional FreeSWITCH Consulting Services:<BR><A href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A><BR><A href="http://www.freeswitchsolutions.com/">http://www.freeswitchsolutions.com</A><BR><BR>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR><A href="http://www.cudatel.com/">http://www.cudatel.com</A><BR><BR>Official FreeSWITCH Sites<BR><A href="http://www.freeswitch.org/">http://www.freeswitch.org</A><BR><A href="http://wiki.freeswitch.org/">http://wiki.freeswitch.org</A><BR><A href="http://www.cluecon.com/">http://www.cluecon.com</A><BR><BR>FreeSWITCH-users mailing list<BR><A href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A><BR><A href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>UNSUBSCRIBE:<A href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR><A href="http://www.freeswitch.org/">http://www.freeswitch.org</A><BR><BR></BLOCKQUOTE></DIV><BR><BR clear=all><BR></DIV></DIV><SPAN class=HOEnZb><FONT color=#888888>-- <BR>Michael S Collins<BR>Twitter: @mercutioviz<BR><A href="http://www.freeswitch.org/">http://www.FreeSWITCH.org</A><BR><A href="http://www.cluecon.com/">http://www.ClueCon.com</A><BR><A href="http://www.ostag.org/">http://www.OSTAG.org</A><BR><BR><BR></FONT></SPAN><BR>_________________________________________________________________________<BR>Professional FreeSWITCH Consulting Services:<BR><A href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A><BR><A href="http://www.freeswitchsolutions.com/">http://www.freeswitchsolutions.com</A><BR><BR>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR><A href="http://www.cudatel.com/">http://www.cudatel.com</A><BR><BR>Official FreeSWITCH Sites<BR><A href="http://www.freeswitch.org/">http://www.freeswitch.org</A><BR><A href="http://wiki.freeswitch.org/">http://wiki.freeswitch.org</A><BR><A href="http://www.cluecon.com/">http://www.cluecon.com</A><BR><BR>FreeSWITCH-users mailing list<BR><A href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A><BR><A href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>UNSUBSCRIBE:<A href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR><A href="http://www.freeswitch.org/">http://www.freeswitch.org</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE>
<STYLE>
</STYLE>

<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></body></html>