Android-Specific API Functions

Below are the functions available in the DPS SDK for Android.  They are referenced in the DPS.h header file.

This document exists to demonstrate the java-specific functions for Android.  Please use Core API Functions as the master API reference.

Initialization

int DPSInitialize(JNIEnv* env, jobject android_context, jstring license_file);

This “wakes” up the algorithm and initializes all tables, variables, etc. Invoke once at start-up. This will return one of the Licensing values.  You must receive AUTH_SUCCESS (integer value 0) for DPS processing to work unrestricted.  If any other value is returned DPS will go into demo mode.  The other values are defined in the DPS.h file.

int DPSGetDPSEnabled();

Get the status of DPS processing.  If 1, then DPS is enabled.  If 0, then DPS is bypassed.

void DPSSetDPSEnabled(int enabled);

Enable or bypass DPS processing.  Use enabled = 1 to turn on DPS.  Use enabled = 0 to turn DPS processing off.  DPS HEAR and User Volume Control (see below) is maintained with DPS off.

Parameter Loading

int DPSLoadPreset(char *fname);

The “Preset” refers to a DPS Profile.  This contains the settings that conform the DPS algorithm to a specific playback device.  For example, this could be Bose Headphones, Klipsch Speakers or a “City” profile that is universal to many devices.

DPS Profiles for Android use the .bgvx format.

This function returns 0 = success, 1 = file doesn’t exist, 2 = invalid preset

int DPSLoadPresetBuf(char *c, int length);

This function is used to load profiles from memory.

Returns 0 = success, 1 = file doesn’t exist, 2 = invalid preset

Note that presets/profiles are typically around 4kB in size.

void DPSFlattenAll(void);

This sets all DPS parameters to a flat state.  The DPS algorithm is still running but there is no effect on the audio.  This maintains the audio latency (total delay caused by the algorithm).

Audio Processing

void DPSProcessBuffer(short *buffer, int numOfFrames, numberOfChannels);

This is how we pass audio to the DPS algorithm for processing.  This function returns the buffer with DPS processing applied.

numOfFrames = number of stereo samples.  The maximum value allowed is 2048.

Currently, the DPS algorithm supports stereo audio only.

All Other API functions

Please refer to DPS Core API functions for all current descriptions.