How to use the meyda.sampleRate function in meyda

To help you get started, we’ve selected a few meyda examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wavesjs / waves-lfo / benchmarks / lib / src / benchRms.js View on Github external
sourceSampleRate: sampleRate,
      });

      suite.add(`lfo:rms\t\tframeSize: ${frameSize}\t`, {
        fn: function() {
          for (let i = 0; i < numFrames; i++) {
            const start = i * frameSize;
            const end = start + frameSize;
            const frame = buffer.subarray(start, end);
            const res = rms.inputSignal(frame);
          }
        },
      });

      Meyda.bufferSize = frameSize;
      Meyda.sampleRate = sampleRate;
      // #todo - windowing function should be 'rect' to skip windowing...
      // https://github.com/meyda/meyda/blob/master/src/utilities.js#L27

      suite.add(`meyda:rms\tframeSize: ${frameSize}\t`, {
        fn: function() {
          for (let i = 0; i < numFrames; i++) {
            const start = i * frameSize;
            const end = start + frameSize;
            const frame = buffer.subarray(start, end);
            const res = Meyda.extract('rms', frame);
          }
        },
      });

      suite.on('cycle', function(event) {
        log.push(String(event.target));
github wavesjs / waves-lfo / benchmarks / lib / src / benchFft.js View on Github external
sourceSampleRate: sampleRate,
      });

      suite.add(`lfo:fft\t\tframeSize: ${frameSize}\t`, {
        fn: function() {
          for (let i = 0; i < numFrames; i++) {
            const start = i * frameSize;
            const end = start + frameSize;
            const frame = buffer.subarray(start, end);
            const res = fft.inputSignal(frame);
          }
        },
      });

      Meyda.bufferSize = frameSize;
      Meyda.sampleRate = sampleRate;

      suite.add(`meyda:fft\tframeSize: ${frameSize}\t`, {
        fn: function() {
          for (let i = 0; i < numFrames; i++) {
            const start = i * frameSize;
            const end = start + frameSize;
            const frame = buffer.subarray(start, end);
            const res = Meyda.extract('amplitudeSpectrum', frame);
          }
        },
      });

      suite.on('cycle', function(event) {
        log.push(String(event.target));
      });
github wavesjs / waves-lfo / benchmarks / lib / src / benchMfcc.js View on Github external
sourceSampleRate: sampleRate,
      });

      suite.add(`lfo:mfcc\tframeSize: ${frameSize}\t`, {
        fn: function() {
          for (let i = 0; i < numFrames; i++) {
            const start = i * frameSize;
            const end = start + frameSize;
            const frame = buffer.subarray(start, end);
            const res = mfcc.inputSignal(frame);
          }
        },
      });

      Meyda.bufferSize = frameSize;
      Meyda.sampleRate = sampleRate;

      suite.add(`meyda:mfcc\tframeSize: ${frameSize}\t`, {
        fn: function() {
          for (let i = 0; i < numFrames; i++) {
            const start = i * frameSize;
            const end = start + frameSize;
            const frame = buffer.subarray(start, end);
            const res = Meyda.extract('mfcc', frame);
          }
        },
      });

      suite.on('cycle', function(event) {
        log.push(String(event.target));
      });

meyda

Real-time feature extraction for the web audio api

MIT
Latest version published 6 months ago

Package Health Score

74 / 100
Full package analysis