[Freeswitch-dev] choppy sound with .wav file played in the background
Hi all, I have another question to ask again :P When I use: switch_ivr_play_file(session, NULL, file_path, NULL); to play a file such as "misc/8000/sorry.wav" directly, the sound is so choppy. Am I doing the background sound playing the right way? Han --
How do you mean when you say "in background"? Are ju running this command from another thread then the channel's own thread? /Peter -----Ursprungligt meddelande----- Från: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] För Han Xin Skickat: den 25 oktober 2011 10:53 Till: freeswitch-dev@lists.freeswitch.org Ämne: [Freeswitch-dev] choppy sound with .wav file played in the background Hi all, I have another question to ask again :P When I use: switch_ivr_play_file(session, NULL, file_path, NULL); to play a file such as "misc/8000/sorry.wav" directly, the sound is so choppy. Am I doing the background sound playing the right way? Han -- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org !DSPAM:4ea6780b32761207110701!
hmm, just one call with two sessions, one is the local session, the other is the remote/partner session. I want to play a indication sound file when I press a button on each side, while the call is ongoing. That's what I mean with the background. sorry for the vague description. Regards, Han ----------------original message----------------- From: "Peter Olsson" To: "'freeswitch-dev@lists.freeswitch.org '" freeswitch-dev@lists.freeswitch.org Date: Tue, 25 Oct 2011 11:00:53 +0200 -------------------------------------------------
How do you mean when you say "in background"? Are ju running this command from another thread then the channel's own thread?
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org ] För Han Xin Skickat: den 25 oktober 2011 10:53 Till: freeswitch-dev@lists.freeswitch.org Ämne: [Freeswitch-dev] choppy sound with .wav file played in the background
Hi all, I have another question to ask again :P
When I use:
switch_ivr_play_file(session, NULL, file_path, NULL);
to play a file such as "misc/8000/sorry.wav" directly, the sound is so choppy.
Am I doing the background sound playing the right way?
Han --
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
!DSPAM:4ea6780b32761207110701!
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
--
For a bridged call you're not supposed to use switch_ivr_play_file(), since the bridge is sending frames in a separate thread. I think switch_ivr_displace_session() should work for your needs. /Peter -----Ursprungligt meddelande----- Från: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] För Han Xin Skickat: den 25 oktober 2011 11:24 Till: freeswitch-dev@lists.freeswitch.org Ämne: Re: [Freeswitch-dev] choppy sound with .wav file played inthebackground hmm, just one call with two sessions, one is the local session, the other is the remote/partner session. I want to play a indication sound file when I press a button on each side, while the call is ongoing. That's what I mean with the background. sorry for the vague description. Regards, Han ----------------original message----------------- From: "Peter Olsson" To: "'freeswitch-dev@lists.freeswitch.org '" freeswitch-dev@lists.freeswitch.org Date: Tue, 25 Oct 2011 11:00:53 +0200 -------------------------------------------------
How do you mean when you say "in background"? Are ju running this command from another thread then the channel's own thread?
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org ] För Han Xin Skickat: den 25 oktober 2011 10:53 Till: freeswitch-dev@lists.freeswitch.org Ämne: [Freeswitch-dev] choppy sound with .wav file played in the background
Hi all, I have another question to ask again :P
When I use:
switch_ivr_play_file(session, NULL, file_path, NULL);
to play a file such as "misc/8000/sorry.wav" directly, the sound is so choppy.
Am I doing the background sound playing the right way?
Han --
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
-- _______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org !DSPAM:4ea67f5932765780018021!
switch_ivr_displace_session() works! Thanks a lot! ----------------original message----------------- From: "Peter Olsson" To: "'freeswitch-dev@lists.freeswitch.org '" freeswitch-dev@lists.freeswitch.org Date: Tue, 25 Oct 2011 11:50:59 +0200 -------------------------------------------------
For a bridged call you're not supposed to use switch_ivr_play_file(), since the bridge is sending frames in a separate thread. I think switch_ivr_displace_session() should work for your needs.
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org ] För Han Xin Skickat: den 25 oktober 2011 11:24 Till: freeswitch-dev@lists.freeswitch.org Ämne: Re: [Freeswitch-dev] choppy sound with .wav file played inthebackground
hmm, just one call with two sessions, one is the local session, the other is the remote/partner session.
I want to play a indication sound file when I press a button on each side, while the call is ongoing. That's what I mean with the background. sorry for the vague description.
Regards, Han
----------------original message----------------- From: "Peter Olsson" To: "'freeswitch-dev@lists.freeswitch.org '" freeswitch-dev@lists.freeswitch.org Date: Tue, 25 Oct 2011 11:00:53 +0200 -------------------------------------------------
How do you mean when you say "in background"? Are ju running this command from another thread then the channel's own thread?
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org ] För Han Xin Skickat: den 25 oktober 2011 10:53 Till: freeswitch-dev@lists.freeswitch.org Ämne: [Freeswitch-dev] choppy sound with .wav file played in the background
Hi all, I have another question to ask again :P
When I use:
switch_ivr_play_file(session, NULL, file_path, NULL);
to play a file such as "misc/8000/sorry.wav" directly, the sound is so choppy.
Am I doing the background sound playing the right way?
Han --
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch -d ev http://www.freeswitch.org
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch -d ev http://www.freeswitch.org
--
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
!DSPAM:4ea67f5932765780018021!
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
--
Han, I think i may have come across this sort of issue before with my first use of the FreeSWITCH system. Have you seen anything such as this in the logs/fs_cli output during the call? 2011-09-28 15:37:12.047658 [DEBUG] switch_ivr.c:577 sofia/internal/1000 Command Execute playback(/usr/local/freeswitch/sounds/en/uk/cg_test/cg_out_test_welcome.wav) EXECUTE sofia/internal/1000 playback(/usr/local/freeswitch/sounds/en/uk/cg_test/cg_out_test_welcome.wav) 2011-09-28 15:37:12.047658 [DEBUG] switch_ivr_play_say.c:1302 Codec Activated L16@8000hz 1 channels 30ms 2011-09-28 15:37:12.107661 [DEBUG] switch_rtp.c:3181 Correct ip/port confirmed. 2011-09-28 15:37:12.317674 [WARNING] mod_sofia.c:1115 Asynchronous PTIME not supported, changing our end from 30 to 20 2011-09-28 15:37:12.317674 [DEBUG] sofia_glue.c:2775 Changing Codec from PCMA@30ms@8000hz to PCMA@20ms@8000hz 2011-09-28 15:37:12.367677 [DEBUG] switch_rtp.c:1527 RE-Starting timer [soft] 160 bytes per 20ms 2011-09-28 15:37:12.367677 [DEBUG] sofia_glue.c:2857 Set Codec sofia/internal/1000 PCMA/8000 20 ms 160 samples 64000 bits I looked into this at the time and my understanding was that I need to try and add PCMA@20i in /usr/local/src/freeswitch/conf/vars.xml and re-compile however i have not revisited the issue yet as i only found this to be an issue with outbound only calls from FS, something i was doing just as a demonstration. I found it can be resolved by updating my handset to set RTP Packet Size to 0.020 (its default was 0.030). I doubt this is of much help but perhaps its worth checking? This is my first contribution to the mailing list and i'm not a greatly experienced used but i did want to raise this as a possibility - apologies if this hasn't been of any use! Thanks, Callum Guy On 25 October 2011 10:24, Han Xin <xin@ind.rwth-aachen.de> wrote:
hmm, just one call with two sessions, one is the local session, the other is the remote/partner session.
I want to play a indication sound file when I press a button on each side, while the call is ongoing. That's what I mean with the background. sorry for the vague description.
Regards, Han
----------------original message----------------- From: "Peter Olsson" To: "'freeswitch-dev@lists.freeswitch.org '" freeswitch-dev@lists.freeswitch.org Date: Tue, 25 Oct 2011 11:00:53 +0200 -------------------------------------------------
How do you mean when you say "in background"? Are ju running this command from another thread then the channel's own thread?
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org ] För Han Xin Skickat: den 25 oktober 2011 10:53 Till: freeswitch-dev@lists.freeswitch.org Ämne: [Freeswitch-dev] choppy sound with .wav file played in the background
Hi all, I have another question to ask again :P
When I use:
switch_ivr_play_file(session, NULL, file_path, NULL);
to play a file such as "misc/8000/sorry.wav" directly, the sound is so choppy.
Am I doing the background sound playing the right way?
Han --
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
!DSPAM:4ea6780b32761207110701!
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
--
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Hi Callum, Thanks for the detailed reply first! My problem was simply solved by using another function "switch_ivr_displace_session()" to play the indication sound file. Anyway it is very nice of you to provide this solution, other developers may get benefit from your contribution. :) Regards, Han ----------------ursprüngliche Nachricht----------------- Von: "Callum Guy" callum.guy@x-on.co.uk An: freeswitch-dev@lists.freeswitch.org Datum: Tue, 25 Oct 2011 10:52:09 +0100 -------------------------------------------------
Han,
I think i may have come across this sort of issue before with my first use of the FreeSWITCH system.
Have you seen anything such as this in the logs/fs_cli output during the call?
2011-09-28 15:37:12.047658 [DEBUG] switch_ivr.c:577 sofia/internal/1000 Command Execute
playback(/usr/local/freeswitch/sounds/en/uk/cg_test/cg_out_test_welc ome.wav) EXECUTE sofia/internal/1000
playback(/usr/local/freeswitch/sounds/en/uk/cg_test/cg_out_test_welc ome.wav) 2011-09-28 15:37:12.047658 [DEBUG] switch_ivr_play_say.c:1302 Codec Activated L16@8000hz 1 channels 30ms 2011-09-28 15:37:12.107661 [DEBUG] switch_rtp.c:3181 Correct ip/port confirmed. 2011-09-28 15:37:12.317674 [WARNING] mod_sofia.c:1115 Asynchronous PTIME not supported, changing our end from 30 to 20 2011-09-28 15:37:12.317674 [DEBUG] sofia_glue.c:2775 Changing Codec from PCMA@30ms @8000hz to PCMA@20ms @8000hz 2011-09-28 15:37:12.367677 [DEBUG] switch_rtp.c:1527 RE-Starting timer [soft] 160 bytes per 20ms 2011-09-28 15:37:12.367677 [DEBUG] sofia_glue.c:2857 Set Codec sofia/internal/1000 PCMA/8000 20 ms 160 samples 64000 bits
I looked into this at the time and my understanding was that I need to try and add PCMA@20i in /usr/local/src/freeswitch/conf/vars.xml and re-compile however i have not revisited the issue yet as i only found this to be an issue with outbound only calls from FS, something i was doing just as a demonstration.
I found it can be resolved by updating my handset to set RTP Packet Size to 0.020 (its default was 0.030). I doubt this is of much help but perhaps its worth checking? This is my first contribution to the mailing list and i'm not a greatly experienced used but i did want to raise this as a possibility - apologies if this hasn't been of any use!
Thanks,
Callum Guy
On 25 October 2011 10:24, Han Xin xin@ind.rwth-aachen.de wrote:
hmm, just one call with two sessions, one is the local session, the other is the remote/partner session.
I want to play a indication sound file when I press a button on each side, while the call is ongoing. That's what I mean with the background. sorry for the vague description.
Regards, Han
----------------original message----------------- From: "Peter Olsson" To: "'freeswitch-dev@lists.freeswitch.org '" freeswitch-dev@lists.freeswitch.org Date: Tue, 25 Oct 2011 11:00:53 +0200 -------------------------------------------------
How do you mean when you say "in background"? Are ju running this command from another thread then the channel's own thread?
/Peter
-----Ursprungligt meddelande----- Från: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org ] För Han Xin Skickat: den 25 oktober 2011 10:53 Till: freeswitch-dev@lists.freeswitch.org Ämne: [Freeswitch-dev] choppy sound with .wav file played in the background
Hi all, I have another question to ask again :P
When I use:
switch_ivr_play_file(session, NULL, file_path, NULL);
to play a file such as "misc/8000/sorry.wav" directly, the sound is so choppy.
Am I doing the background sound playing the right way?
Han --
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch -d
!DSPAM:4ea6780b32761207110701!
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch -d
--
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch -dev http://www.freeswitch.org
__________________________________________________
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-d ev http://www.freeswitch.org
--
participants (3)
-
Callum Guy
-
Han Xin
-
Peter Olsson