Returns a frequency capture of currently playing audio content.
This method must be called when the Visualizer is enabled.
The capture is an 8-bit magnitude FFT, the frequency range covered being 0 (DC) to half of the sampling rate returned by getSamplingRate()
. The capture returns the real and imaginary parts of a number of frequency points equal to half of the capture size plus one.
Note: only the real part is returned for the first point (DC) and the last point (sampling frequency / 2).
The layout in the returned byte array is as follows:
Index
| 0
| 1
| 2
| 3
| 4
| 5
| ...
| n - 2
| n - 1
|
Data
| Rf0
| Rf(n/2)
| Rf1
| If1
| Rf2
| If2
| ...
| Rf(n-1)/2
| If(n-1)/2
|
fft | array of bytes where the FFT should be returned |
---|
SUCCESS
in case of success, ERROR_NO_MEMORY
, ERROR_INVALID_OPERATION
or ERROR_DEAD_OBJECT
in case of failure.联系客服