Sorry i was busy working something else last few days. I have started going
through the code before changes. Before I go and start making mess in
stable code I want to be clear on what I am doing.
In prerecorded application I think following lines are responsible to
finally play a file.
1- file->open() ---- Open the file of correct codec as per payload-type.
2- setOutput(file); ---- It i think copies the buffer into session to
finally play.
3- AmSession::onSessionStart(); ---- This starts playing the file.
Now the real reason i want to implement this in playfile() function of
DSM.cpp because I want to use playfile_precoded (Lets say) multiple times
(I want to play files like "You.g729", then "have.g729" then
"Hundred.g729"...and so on.
If we maky a playfile_precoded() it will be like this ...
{
AmPrecodedFileInstance* file =
file_def->getFileInstance(RTPStream()->getPayloadType());
if (!file) {
ERROR("no payload\n");
}
if (!file || file->open()) {
ERROR("PrecodedDialog::onSessionStart: Cannot open file\n");
dlg->bye();
setStopped();
return;
}
setOutput(file);
}
But if i call this function multiple times wouldn't it set buffer to last
file?.. There should be some kind of queue to really work it out (Or may be
there already is)
Also I need to implement Stop Function?
On Wed, Sep 24, 2014 at 4:25 PM, John Nash <[email protected]> wrote:
> Thank you for the pointer. I am gonna try it and let you know. (Sorry for
> the typo)
>
> On Wed, Sep 24, 2014 at 1:49 PM, Stefan Sayer <[email protected]>
> wrote:
>
>> Hi,
>>
>> John Nash wrote on 09/24/2014 05:55 AM:
>> > I am using SEMS a media server and using custom IVR to play dynamic
>> > announcements using DSM script. I am using "Playfile" function to play
>> > wav file It works OK but I want to play prerecorded sound files. I am
>> prerecorded or precoded? ;)
>>
>> > aware of "precoded_announce" application but how can I use that in DSM
>> > Script to play whatever file I want?
>> not currently possible with DSM. you could extend it easily though,
>> the same way that playFile works, by using AmPrecodedFile instead of
>> AmAudioFile, the way it's used in PrecodedAnnounce. You'll also need
>> to set sess->RTPStream()->setPayloadProvider(file_def) though (and
>> best save that before with getPayloadProvider and set it back after
>> the precoded file.
>>
>> hth
>> Stefan
>>
>> >
>> > Regards
>> >
>> > J. Nash
>> >
>> >
>> > _______________________________________________
>> > Sems mailing list
>> > [email protected]
>> > http://lists.iptel.org/mailman/listinfo/sems
>> >
>>
>>
>
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems