John Nash wrote on 09/28/2014 06:11 AM:
> 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.
not really, it sets the pointer of the session's output so that when
audio is requested its read from there
> 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)
there is a Playlist already in place for DSM. playFile in DSM just
adds them to the playlist, you can simply do the same with a precoded
file instance. have a look at the code in DSMCall and DSMCoreModule.
>
> Also I need to implement Stop Function?
already taken care of
stefan
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems