我要评分
获取效率
正确性
完整性
易理解

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); 
}