TAPIEx ActiveX Control v3.6

PlaybackFile

The PlaybackFile method playback wave file (or wave/out Redirection ). [asynchronous]

Function PlaybackFile(
FileName As String
) As Boolean

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.
CUSTOM:TONES?[freq1|freq2|..|freqn@duration,...] Generate a serial of custom tones follow the pattern like [freq@duration] by software, for more information, please see the example below.
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

Since most of the voice modem is half duplex, it only have one terminal, either play or record has to be selected at a time.

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
	.PlaybackFile("CUSTOM:TONES?350|440@8000ms,0@400ms")	'  send custom tones, multi-frequency tone 350Hz and 440ms (US dial tone) follow by 400ms silence
	.PlaybackFile("CUSTOM:TONES?480|620@500,0@500ms")		'  send custom tones, multi-frequency tone 480Hz and 620Hz in 500ms duration follow by 500ms silence ( US busy tone )
	
   '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

OnPlayBackComplete, PlayMemoryBuffer