Description
The PlaybackFile method playback wave file (or wave/out Redirection ). [asynchronous]
[Visual Basic]
Function PlaybackFile( FileName As String ) As Boolean
[C#]
public Boolean PlaybackFile ( String FileName )
Parameters
- FileName
- The wave file contain the sound track which want to play. Default wave format
is PCM Mono 8000Hz 16bit.
It can also be the specific string represent wave/out Redirection
Redirection String Meaning ACCESS:WAVEOUTBUFFER Users want to access the wave out buffer. It means that users can send the RAW PCM wave buffer data to the wave/out device. OnWaveOutBuffer() (For how to use it, please read the "Access wave/out buffer" demo for VB or Delphi) TTY:SEND?[Text that want to sent] Generate the TTY Baudot signal. (For detail about it, please read the "TTY/TDD Send/Receive" Demo. DTMF:GENERATE?[DTMF keys] Generate the DTMF key by software. REDIRECT:FROMWAVEIN Redirect the wave stream from the recording on the fly. It must be used pair of Record("ACCESS:WAVEINBUFFER"). For more info, please refer the sample code below or the "Redirect Wave Stream" demo sample.
Return values
- If the method succeeds, return TRUE. If the function fails, the return value is FALSE, The application will receive the OnError() event. To get extended error information, using ErrCode or ErrString property, or just get it from OnError parameter. this can be one or more of the following values.
-
Attribute Meaning ERR_FILENOTEXIST Play back wave file not exist. ERR_NOTCONNECTED Call not connected, this method can not perform. ERR_PLAYBACKBUSY Terminal is busy, Playing! ERR_RECORDBUSY Terminal is busy, Recording! ERR_CANNOTPLAYBACKFILE Can not play back the file through the device, either files have already been damaged , or the file format is incorrect.
Remarks
We had added the playlist function to the playbackfile() method , so all the playbackfile() request will accept, and the wave files in the playlist will play one by one.
Using StopPlayback() stop the playback and clear the all the items in the playlist.
Example:
.PlaybackFile("ACCESS:WAVEOUTBUFFER") .PlaybackFile("TTY:SEND?This is a test.") ' Send TTY signal .PlaybackFile("DTMF:GENERATE?0123456789*#") ' send DTMF keys 'Redirect code sample : play the voice from the phone to the sound card mTAPIEx.WavePlayDeviceClass = "wave_mapper" mTAPIEx.WaveRecordDeviceClass = "wave/in" currCall.PlaybackFile "REDIRECT:FROMWAVEIN" ' start wave/out first currCall.Record "ACCESS:WAVEINBUFFER"
See Also
Support editions


