Offline Audio Feature Extraction in NodeJS

node v10.24.1
version: master
Import Meyda and define a signal to test against
var Meyda = require('meyda');
We construct a signal that crosses the zero threshold 15 times. The signal is of a length that is a power of 2 - 32 - this is because Meyda requires input signals to be a power of two in order to optimize for the fast fourier transform that is required for most other feature extractors
var signal = (new Array(32).fill(0).map((element, index) => { const remainder = index % 3; if (remainder === 0) { return 1; } else if (remainder === 1) { return 0; } return -1; }));
Finally, we call the Zero Crossing Rate audio feature extractor on the signal we defined.
Meyda.extract('zcr', signal);
As we can see, it correctly counts 15 crosses of zero in the signal duration.

1 comment

  • posted 4 years ago by barretomarcospaulo556637
    Hello, how do I extract this signal from an audio?

sign in to comment