fftSize property

int get fftSize

Gets the current Fast Fourier Transform (FFT) size.

It determines the number of samples used in the FFT analysis and thus the length of the _waveformData.

Implementation

int get fftSize => _fftSize;
set fftSize (int size)

Sets the Fast Fourier Transform (FFT) size.

The size must be a power of 2 between 32 and 32768. If an invalid value is provided, it will be adjusted. This also affects the size of _waveformData and frequencyBinCount.

Implementation

set fftSize(int size) {
  size = _ensureValidFFTSize(size);

  _fftSize = size;

  try {
    _analyserNode?.fftSize = size;
  } catch (e) {
    warn('Error setting fftSize: $e');
  }
}