Re: [Opalvoip-user] Have problems playing wav files
Brought to you by:
csoutheren,
rjongbloed
|
From: Robert J. <ro...@vo...> - 2014-03-12 02:26:06
|
On 7/03/2014 9:34 PM, Kruck, Wolfgang wrote:
> I have several problems playing wav files. The problems depends on if
> my test program make the call or receive a call.
>
> In the initialization of my program I set a file with
>
> pcssEP->SetSoundChannelRecordDevice("example.wav");
>
> If a call is made or an incoming call is accepted, then the file
> example.wav will played.
>
> The playing of the file behaves different and depends on making a call
> or receiving a call.
>
> If a call is made, then the file example.wav is played only once. If a
> call is received, than the wav file plays in an endless loop.
>
> What can I do to make sure, that the file will be played only once?
>
That is very strange. In both cases it should have only played once.
> Later on in a call, I will play other wav files depending on user
> input (DTMF). To do that, I use the function
>
> m_activeCall->Transfer(bOnHold? "pc:*|newFile.wav*": "pc:*"));
>
> The file newFile.wav will than played in an endless loop. What can I
> do, to play that file only once?
>
Do not put the trailing '*' on the file name. That is the indication to
repeat the file.
> Depending on user input I have to play several wav files. To do that I
> need to know when the end of the actual played file is reached to play
> the next file.
>
> Is it possible to get a callback when a file is played so that I can
> play several files seamless one after another?
>
As I think Dmity suggested, if you have complex file playing
requirements, you should use the IVR subsystem which takes industry
standard VXML files.
If the application is completely automated, no human being involved
which means no speaker or microphone, then look at the opal/samples/ivr
directory for how to do this.
*Robert Jongbloed*
/OPAL/OpenH323/PTLib Architect and Co-founder./
Commercial support at http://www.voxlucida.com.au
|