Constructor
new AudioAnalyser( audio : Audio, fftSize : number )
Constructs a new audio analyzer.
| audio |
The audio to analyze. |
| fftSize |
The window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data. Default is |
Properties
.analyser : AnalyserNode
The global audio listener.
.data : Uint8Array
Holds the analyzed data.
Methods
.getAverageFrequency() : number
Returns the average of the frequencies returned by AudioAnalyser#getFrequencyData.
- Returns: The average frequency.
.getFrequencyData() : Uint8Array
Returns an array with frequency data of the audio.
Each item in the array represents the decibel value for a specific frequency. The frequencies are spread linearly from 0 to 1/2 of the sample rate. For example, for 48000 sample rate, the last item of the array will represent the decibel value for 24000 Hz.
- Returns: The frequency data.