How to stop and replay an audio from the beginning?
Hi there, I would like to know what is the preferred way to do the following. My application is this: Make a phone call to a person, after the person picks up the phone an message would play. If he presses the * key, the message would stop and start from the beginning again. I am using C# to start the call and play an audio using PlayAndGetDigits() while in my C++ code would check the DTMF event. If it finds a * key pressed, it will call the uuid_displace with the same file (but for testing purpose, I am using different file). This is not working right because I can hear that the new audio file is playing on top of the original audio instead of stopping the original audio and play the new audio. Anyone has an idea how I should do this? Thanks in advance. Frankie
I don't know if what you're doing is the optimal way or not, but I'm pretty sure that if you are playing a second file then you need to break out of playing the first file. Look at the uuid_break API for ideas on how to do that. -MC On Fri, Apr 8, 2011 at 11:51 AM, Frankie Yiu <frankie.k.yiu@gmail.com>wrote:
Hi there,
I would like to know what is the preferred way to do the following. My application is this: Make a phone call to a person, after the person picks up the phone an message would play. If he presses the * key, the message would stop and start from the beginning again. I am using C# to start the call and play an audio using PlayAndGetDigits() while in my C++ code would check the DTMF event. If it finds a * key pressed, it will call the uuid_displace with the same file (but for testing purpose, I am using different file). This is not working right because I can hear that the new audio file is playing on top of the original audio instead of stopping the original audio and play the new audio.
Anyone has an idea how I should do this?
Thanks in advance.
Frankie
_______________________________________________ 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
After the PlayAndGetDigits() terminates on the *, loop around and play again with PlayAndGetDigits() . don't use displace. ----- Original Message ----- From: "Michael Collins" <msc@freeswitch.org> To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Sent: Friday, April 08, 2011 12:58 PM Subject: Re: [Freeswitch-users] How to stop and replay an audio from thebeginning?
I don't know if what you're doing is the optimal way or not, but I'm pretty sure that if you are playing a second file then you need to break out of playing the first file. Look at the uuid_break API for ideas on how to do that.
-MC
On Fri, Apr 8, 2011 at 11:51 AM, Frankie Yiu <frankie.k.yiu@gmail.com>wrote:
Hi there,
I would like to know what is the preferred way to do the following. My application is this: Make a phone call to a person, after the person picks up the phone an message would play. If he presses the * key, the message would stop and start from the beginning again. I am using C# to start the call and play an audio using PlayAndGetDigits() while in my C++ code would check the DTMF event. If it finds a * key pressed, it will call the uuid_displace with the same file (but for testing purpose, I am using different file). This is not working right because I can hear that the new audio file is playing on top of the original audio instead of stopping the original audio and play the new audio.
Anyone has an idea how I should do this?
Thanks in advance.
Frankie
_______________________________________________ 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
you would at least have to disable the displace you already called since you can have concurrent displace bugs On Fri, Apr 8, 2011 at 1:51 PM, Frankie Yiu <frankie.k.yiu@gmail.com> wrote:
Hi there,
I would like to know what is the preferred way to do the following. My application is this: Make a phone call to a person, after the person picks up the phone an message would play. If he presses the * key, the message would stop and start from the beginning again. I am using C# to start the call and play an audio using PlayAndGetDigits() while in my C++ code would check the DTMF event. If it finds a * key pressed, it will call the uuid_displace with the same file (but for testing purpose, I am using different file). This is not working right because I can hear that the new audio file is playing on top of the original audio instead of stopping the original audio and play the new audio.
Anyone has an idea how I should do this? Thanks in advance.
Frankie _______________________________________________ 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/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
participants (4)
-
Anthony Minessale
-
Frankie Yiu
-
Kris
-
Michael Collins