[Freeswitch-users] playback: Easy ways to handle different situations?
odermann at googlemail.com
Tue Oct 21 02:29:03 PDT 2008
I am fiddling arround with fs and different situations to handle
playbacks and wonder, if there are some tricks or options, to tell
"playback", to handle playbacks in different ways?
What I found out till now:
1.) If i want to stop a playback, I have to send a "break"...
2.) If I playback a soundfile (#1) and tell fs to play another
soundfile (#2), while #1 is still playing back, fs behaves as follow:
#1 will pause, #2 will be played back and after #2 was played back, #1
will continue to play back.
Why is this the default behavior?
I want to the following and would like to ask, if there are or will be
some options to do that in an easy way:
1.) Stop a playing file, by sending a new playback command with another file:
Although I can figure out some situations, where the behavior
described in 2.) could be useful, I would like to have the option, to
tell fs with playback, to permanently stop the current playing file
and replace it with the new file.
Otherwise I always first have to send a "break", then wait for the
"CHANNEL_EXECUTE_COMPLETE" and then send the new playfile command.
Perhaps it would be easier, if fs could handle that.
2.) Play a list of files, one after the other:
I would like to play a number of files in a row. For exaple I want to
tell the caller, how much money he has left.
Let's say, he has 12,55 (whatever) left. So I have to play 3 files:
twelve.wav - fifty.wav - five.wav.
As far as I see, I have to play the file "twelve.wav", wait for
"CHANNEL_EXECUTE_COMPLETE" in conjuntion with "playback", play the
file "fifty.wav", wait and so on...
Another option to play a list would be, to use the behavior, described
in the first 2.). Because a first called playback will pause, when
another playback is sent, I could send 3 playback commands with the
three files in a reversed order. playback five.wav, playback
fifty.wav, blayback twelve.wav. Because the first two files will be
paused, twelve.wav will be played first.
Is this the way I have to go or are there chances, that there is a
slicker solution for this?
Thanks for the help.
More information about the FreeSWITCH-users