Rate This Document
Findability
Accuracy
Completeness
Readability

registerAudioSendHook

Function Usage

Registers the hook function for sending audio data.

Restrictions

N/A

Prototype

int registerAudioSendHook(AUDIOSENDHOOK hook)

Parameters

Field Name

Input/Output

Field Type

Description

hook

Input

AUDIOSENDHOOK

The engine users need to mount the audio data sending function they have implemented to this hook.

public interface AUDIOSENDHOOK {

void audioSendData(byte[] data, int length);

}

  • data: data storage address
  • length: data length

Returns

Data type: int

The value can be:

  • VMI_SUCCESS: Success
  • VMI_AUDIO_CLIENT_SENDHOOK_REGISTER_FAIL: Failed to register the hook function for sending audio data on the audio engine client.

Example Call

1
2
3
4
5
void Test()  
{ 
    // DataPipe is the class that implements the AUDIOSENDHOOK API.
    int ret = AudioTrackPlayer.getInstance().registerAudioSendHook(DataPipe.getInstance()); 
}