onRecvAudioPacket
Function Usage
Receives and processes audio data.
Restrictions
This API is called to receive each data packet sent by the audio engine server.
Prototype
int onRecvAudioPacket(byte[] data, int length)
Parameters
Field Name |
Input/Output |
Field Type |
Description |
|---|---|---|---|
data |
Input |
byte array |
Received audio data array. |
length |
Input |
int |
Length of the received audio data array. |
Returns
Data type: int
The value can be:
- VMI_SUCCESS: Success
- VMI_AUDIO_ENGINE_CLIENT_RECV_FAIL: The audio engine client fails to receive or process data.
Example Call
1 2 3 4 5 | void Test() { // data indicates a packet of audio data received by the client. The data type is byte array. int ret = AudioTrackPlayer.getInstance().onRecvAudioPacket(data, data.length); } |
Parent topic: External APIs of the Audio Engine Client (Java)