PortSIP VoIP SDK Manual for Android  16.2
PortSIP features our newest, supported, quality-assured VoIP SDK used by Several hundred companies around the world for easy VoIP application develop and quality-assured code.
Functions
Play audio and video file to remote functions

Functions

int com.portsip.PortSipSdk.playVideoFileToRemote (long sessionId, String aviFile, boolean loop, boolean playAudio)
 
int com.portsip.PortSipSdk.stopPlayVideoFileToRemote (long sessionId)
 
int com.portsip.PortSipSdk.playAudioFileToRemote (long sessionId, String filename, int fileSamplesPerSec, boolean loop)
 
int com.portsip.PortSipSdk.stopPlayAudioFileToRemote (long sessionId)
 
int com.portsip.PortSipSdk.playAudioFileToRemoteAsBackground (long sessionId, String filename, int fileSamplesPerSec)
 
int com.portsip.PortSipSdk.stopPlayAudioFileToRemoteAsBackground (long sessionId)
 
void com.portsip.PortSipSdk.audioPlayLoopbackTest (boolean enable)
 

Detailed Description

Function Documentation

◆ playVideoFileToRemote()

int com.portsip.PortSipSdk.playVideoFileToRemote ( long  sessionId,
String  aviFile,
boolean  loop,
boolean  playAudio 
)

Play an AVI file to remote party.

Parameters
sessionIdSession ID of the call.
aviFileThe full filepath, such as "/mnt/sdcard/test.avi".
loopSet to false to stop playing video file when it is ended, or true to play it repeatedly.
playAudioIf set to true, audio and video will be played together; or false to play the video only.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ stopPlayVideoFileToRemote()

int com.portsip.PortSipSdk.stopPlayVideoFileToRemote ( long  sessionId)

Stop play video file to remote side.

Parameters
sessionIdSession ID of the call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ playAudioFileToRemote()

int com.portsip.PortSipSdk.playAudioFileToRemote ( long  sessionId,
String  filename,
int  fileSamplesPerSec,
boolean  loop 
)

Play a wave file to remote party.

Parameters
sessionIdSession ID of the call.
filenameThe full filepath, such as "/mnt/sdcard/test.wav".
fileSamplesPerSecThe wave file sample in seconds. It could be 8000, 16000 or 32000.
loopSet to false to stop playing audio file when it is ended, or true to play it repeatedly.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ stopPlayAudioFileToRemote()

int com.portsip.PortSipSdk.stopPlayAudioFileToRemote ( long  sessionId)

Stop playing wave file to remote side.

Parameters
sessionIdSession ID of the call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ playAudioFileToRemoteAsBackground()

int com.portsip.PortSipSdk.playAudioFileToRemoteAsBackground ( long  sessionId,
String  filename,
int  fileSamplesPerSec 
)

Play a wave file to remote party as conversation background sound.

Parameters
sessionIdSession ID of the call.
filenameThe full filepath, such as "/mnt/sdcard/test.wav".
fileSamplesPerSecThe wave file sample, in seconds. It should be 8000, 16000 or 32000.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ stopPlayAudioFileToRemoteAsBackground()

int com.portsip.PortSipSdk.stopPlayAudioFileToRemoteAsBackground ( long  sessionId)

Stop playing a wave file to remote party as background sound for the conversation.

Parameters
sessionIdSession ID of the call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ audioPlayLoopbackTest()

void com.portsip.PortSipSdk.audioPlayLoopbackTest ( boolean  enable)

Used for testing loopback for the audio device.

Parameters
enableSet to true to start testing audio loopback test; or set to false to stop.