Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
analyser.getAudioFeatures = () => {
analyser.getByteFrequencyData(freqDataArray);
analyser.getFloatTimeDomainData(timeDataFloatArray);
const frequencyData = Array.from(freqDataArray);
Meyda.fftSize = fftSize;
Meyda.bufferSize = fftSize;
const {mfcc, spectralCentroid, rms, loudness} = Meyda.extract([
'mfcc',
'spectralCentroid',
'rms',
'loudness',
],
timeDataFloatArray
);
return {frequencyData, rms, mfcc, spectralCentroid, loudness: loudness.total};
};
return analyser;