Javascript: stream, speak, stream - cepstral cut offs 2nd stream
Hi, In javascript I doing the following: var consumer_name = "Birgit Arkesteijn"; var endpoint_url = 'sofia/gateway/westhawk/0662'; var mSession = new Session("{ignore_early_media=true,originate_timeout=8}" + endpoint_url); var ready = mSession.ready(); // log("merchant answered: " + ready); if (ready == true) { mSession.streamFile("westhawk/lead_waiting.wav", dummy); mSession.speak("cepstral", "Diane", "<break time='2s'/>" + consumer_name); // msleep(500); mSession.streamFile("westhawk/consumer_hungup.wav", dummy); exit(); } function dummy(session, type, data, arg){} No matter what I try, cepstral somehow cuts off the beginning two seconds of the second streamFile(). Adding a msleep(500) in between 'speak' and 'streamFile' makes it only worse. I'm running FreeSWITCH Version 1.0.trunk (597:10325M) Started. and Cepstral_Diane_x86-64-linux_5.1.0/ on Linux Suse 10.0 x86_64 Any ideas? Thanks, Birgit -- -- Birgit Arkesteijn, birgit@westhawk.co.uk, -- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK -- Company no: 1769350 -- Registered Office: -- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK. -- tel.: +44 (0)161 237 0660 -- <URL: http://www.westhawk.co.uk>
you never want to msleep during a js running on a call you should use session.sleep(500); msleep blocks the whole thread and thus the audio. On Mon, Nov 17, 2008 at 1:05 PM, Birgit Arkesteijn <birgit@westhawk.co.uk>wrote:
Hi,
In javascript I doing the following:
var consumer_name = "Birgit Arkesteijn"; var endpoint_url = 'sofia/gateway/westhawk/0662'; var mSession = new Session("{ignore_early_media=true,originate_timeout=8}" + endpoint_url); var ready = mSession.ready(); // log("merchant answered: " + ready); if (ready == true) { mSession.streamFile("westhawk/lead_waiting.wav", dummy); mSession.speak("cepstral", "Diane", "<break time='2s'/>" + consumer_name); // msleep(500); mSession.streamFile("westhawk/consumer_hungup.wav", dummy); exit(); } function dummy(session, type, data, arg){}
No matter what I try, cepstral somehow cuts off the beginning two seconds of the second streamFile(). Adding a msleep(500) in between 'speak' and 'streamFile' makes it only worse.
I'm running FreeSWITCH Version 1.0.trunk (597:10325M) Started. and Cepstral_Diane_x86-64-linux_5.1.0/ on Linux Suse 10.0 x86_64
Any ideas?
Thanks, Birgit
-- -- Birgit Arkesteijn, birgit@westhawk.co.uk, -- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK -- Company no: 1769350 -- Registered Office: -- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK. -- tel.: +44 (0)161 237 0660 -- <URL: http://www.westhawk.co.uk>
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Hi, Thanks, Anthony, for your reply. mSession.sleep(100); does indeed do the trick! Cheers, Birgit On 17/11/08 19:51, Anthony Minessale wrote:
you never want to msleep during a js running on a call you should use session.sleep(500); msleep blocks the whole thread and thus the audio.
On Mon, Nov 17, 2008 at 1:05 PM, Birgit Arkesteijn <birgit@westhawk.co.uk>wrote:
Hi,
In javascript I doing the following:
var consumer_name = "Birgit Arkesteijn"; var endpoint_url = 'sofia/gateway/westhawk/0662'; var mSession = new Session("{ignore_early_media=true,originate_timeout=8}" + endpoint_url); var ready = mSession.ready(); // log("merchant answered: " + ready); if (ready == true) { mSession.streamFile("westhawk/lead_waiting.wav", dummy); mSession.speak("cepstral", "Diane", "<break time='2s'/>" + consumer_name); // msleep(500); mSession.streamFile("westhawk/consumer_hungup.wav", dummy); exit(); } function dummy(session, type, data, arg){}
No matter what I try, cepstral somehow cuts off the beginning two seconds of the second streamFile(). Adding a msleep(500) in between 'speak' and 'streamFile' makes it only worse.
I'm running FreeSWITCH Version 1.0.trunk (597:10325M) Started. and Cepstral_Diane_x86-64-linux_5.1.0/ on Linux Suse 10.0 x86_64
Any ideas?
Thanks, Birgit
-- -- Birgit Arkesteijn, birgit@westhawk.co.uk, -- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK -- Company no: 1769350 -- Registered Office: -- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK. -- tel.: +44 (0)161 237 0660 -- <URL: http://www.westhawk.co.uk>
participants (2)
-
Anthony Minessale
-
Birgit Arkesteijn