public interface

IHQVisualizer

implements IReleasable
com.h6ah4i.android.media.audiofx.IHQVisualizer
Known Indirect Subclasses

Summary

Nested Classes
interface IHQVisualizer.OnDataCaptureListener The OnDataCaptureListener interface defines methods called by the Visualizer to periodically update the audio visualization capture. 
Constants
int ALREADY_EXISTS Internal operation status.
int ERROR Unspecified error.
int ERROR_BAD_VALUE Operation failed due to bad parameter value.
int ERROR_DEAD_OBJECT Operation failed due to dead remote object.
int ERROR_INVALID_OPERATION Operation failed because it was requested in wrong state.
int ERROR_NO_INIT Operation failed due to bad object initialization.
int ERROR_NO_MEMORY Operation failed due to lack of memory.
int STATE_ENABLED State of a Visualizer object that is active.
int STATE_INITIALIZED State of a Visualizer object that is ready to be used.
int STATE_UNINITIALIZED State of a Visualizer object that was not successfully initialized upon creation
int SUCCESS Successful operation.
int WINDOW_BLACKMAN Blackman window.
int WINDOW_FLAT_TOP Flat top window.
int WINDOW_HAMMING Hamming window.
int WINDOW_HANN Hann window.
int WINDOW_OPT_APPLY_FOR_WAVEFORM Option flag to specify whether the window function is also effects to thecaptured waveform data.
int WINDOW_RECTANGULAR Rectangular window.
Public Methods
abstract int getCaptureSize()
Returns current capture size.
abstract int[] getCaptureSizeRange()
Returns the capture size range.
abstract boolean getEnabled()
Get current activation state of the visualizer.
abstract int getMaxCaptureRate()
Returns the maximum capture rate for the callback capture method.
abstract int getNumChannels()
Returns the number of channels of the captured audio.
abstract int getSamplingRate()
Returns the sampling rate of the captured audio.
abstract int getWindowFunction()
Returns current window function type.
abstract int setCaptureSize(int size)
Sets the capture size, i.e.
abstract int setDataCaptureListener(IHQVisualizer.OnDataCaptureListener listener, int rate, boolean waveform, boolean fft)
Registers an OnDataCaptureListener interface and specifies the rate at which the capture should be updated as well as the type of capture requested.
abstract int setEnabled(boolean enabled)
Enable or disable the visualization engine.
abstract int setWindowFunction(int windowType)
Sets the window function type.
[Expand]
Inherited Methods
From interface com.h6ah4i.android.media.IReleasable

Constants

public static final int ALREADY_EXISTS

Internal operation status. Not returned by any method.

Constant Value: -2 (0xfffffffe)

public static final int ERROR

Unspecified error.

Constant Value: -1 (0xffffffff)

public static final int ERROR_BAD_VALUE

Operation failed due to bad parameter value.

Constant Value: -4 (0xfffffffc)

public static final int ERROR_DEAD_OBJECT

Operation failed due to dead remote object.

Constant Value: -7 (0xfffffff9)

public static final int ERROR_INVALID_OPERATION

Operation failed because it was requested in wrong state.

Constant Value: -5 (0xfffffffb)

public static final int ERROR_NO_INIT

Operation failed due to bad object initialization.

Constant Value: -3 (0xfffffffd)

public static final int ERROR_NO_MEMORY

Operation failed due to lack of memory.

Constant Value: -6 (0xfffffffa)

public static final int STATE_ENABLED

State of a Visualizer object that is active.

Constant Value: 2 (0x00000002)

public static final int STATE_INITIALIZED

State of a Visualizer object that is ready to be used.

Constant Value: 1 (0x00000001)

public static final int STATE_UNINITIALIZED

State of a Visualizer object that was not successfully initialized upon creation

Constant Value: 0 (0x00000000)

public static final int SUCCESS

Successful operation.

Constant Value: 0 (0x00000000)

public static final int WINDOW_BLACKMAN

Blackman window.

Constant Value: 3 (0x00000003)

public static final int WINDOW_FLAT_TOP

Flat top window.

Constant Value: 4 (0x00000004)

public static final int WINDOW_HAMMING

Hamming window.

Constant Value: 2 (0x00000002)

public static final int WINDOW_HANN

Hann window.

Constant Value: 1 (0x00000001)

public static final int WINDOW_OPT_APPLY_FOR_WAVEFORM

Option flag to specify whether the window function is also effects to thecaptured waveform data.

Constant Value: -2147483648 (0x80000000)

public static final int WINDOW_RECTANGULAR

Rectangular window.

Constant Value: 0 (0x00000000)

Public Methods

public abstract int getCaptureSize ()

Returns current capture size.

Returns
  • the capture size in frames.
Throws
IllegalStateException

public abstract int[] getCaptureSizeRange ()

Returns the capture size range.

Returns
  • the minimum capture size is returned in first array element and the maximum in second array element.
Throws
IllegalStateException

public abstract boolean getEnabled ()

Get current activation state of the visualizer.

Returns
  • true if the visualizer is active, false otherwise

public abstract int getMaxCaptureRate ()

Returns the maximum capture rate for the callback capture method. This is the maximum value for the rate parameter of the setDataCaptureListener(OnDataCaptureListener, int, boolean, boolean) method.

Returns
  • the maximum capture rate expressed in milliHertz
Throws
IllegalStateException

public abstract int getNumChannels ()

Returns the number of channels of the captured audio.

Returns
  • the number of channels.
Throws
IllegalStateException

public abstract int getSamplingRate ()

Returns the sampling rate of the captured audio.

Returns
  • the sampling rate in milliHertz.
Throws
IllegalStateException

public abstract int getWindowFunction ()

Returns current window function type.

Returns
  • current window function type.
Throws
IllegalStateException

public abstract int setCaptureSize (int size)

Sets the capture size, i.e. the number of frames captured by OnDataCaptureListener event. The capture size must be a power of 2 in the range returned by getCaptureSizeRange(). This method must not be called when the Visualizer is enabled.

Parameters
size requested capture size
Returns
Throws
IllegalStateException

public abstract int setDataCaptureListener (IHQVisualizer.OnDataCaptureListener listener, int rate, boolean waveform, boolean fft)

Registers an OnDataCaptureListener interface and specifies the rate at which the capture should be updated as well as the type of capture requested.

Call this method with a null listener to stop receiving the capture updates.

Parameters
listener OnDataCaptureListener registered
rate rate in milliHertz at which the capture should be updated
waveform true if a waveform capture is requested: the onWaveFormDataCapture() method will be called on the OnDataCaptureListener interface.
fft true if a frequency capture is requested: the onFftDataCapture() method will be called on the OnDataCaptureListener interface.
Returns

public abstract int setEnabled (boolean enabled)

Enable or disable the visualization engine.

Parameters
enabled requested enable state
Returns
Throws
IllegalStateException

public abstract int setWindowFunction (int windowType)

Sets the window function type.

Parameters
windowType window function type. One of the = 0, WINDOW_HANN, WINDOW_HAMMING, WINDOW_BLACKMAN, WINDOW_FLAT_TOP with optional WINDOW_OPT_APPLY_FOR_WAVEFORM flag.
Returns
Throws
IllegalStateException