Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

meyda

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meyda - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

2

bower.json
{
"name": "meyda",
"main": "dist/web/meyda.min.js",
"version": "3.0.2",
"version": "3.0.3",
"homepage": "https://github.com/hughrawlinson/meyda",

@@ -6,0 +6,0 @@ "authors": [

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].signal) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function (args) {

@@ -11,0 +11,0 @@ if (_typeof(args.ampSpectrum) !== "object" || _typeof(args.barkScale) !== "object") {

'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function (args) {

@@ -11,0 +11,0 @@ if (_typeof(args.ampSpectrum) !== "object" || _typeof(args.melFilterBank) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].signal) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].signal) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].ampSpectrum) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function (args) {

@@ -11,0 +11,0 @@ if (_typeof(args.signal) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].ampSpectrum) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].ampSpectrum) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].ampSpectrum) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].ampSpectrum) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function (args) {

@@ -11,0 +11,0 @@ if (_typeof(args.ampSpectrum) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function (args) {

@@ -11,0 +11,0 @@ if (_typeof(args.ampSpectrum) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function (args) {

@@ -11,0 +11,0 @@ if (_typeof(args.ampSpectrum) !== "object") {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
exports.default = function () {

@@ -11,0 +11,0 @@ if (_typeof(arguments[0].signal) !== "object") {

'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +7,4 @@ value: true

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _utilities = require('./utilities');

@@ -28,4 +28,2 @@

var MeydaAnalyzer = _interopRequireWildcard(_meydaWa);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

@@ -54,3 +52,3 @@

createMeydaAnalyzer: function createMeydaAnalyzer(options) {
return new MeydaAnalyzer(options, this);
return new _meydaWa.MeydaAnalyzer(options, this);
},

@@ -125,3 +123,4 @@

if (typeof window !== "undefined") window.Meyda = Meyda;
module.exports = exports['default'];
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MeydaAnalyzer = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _utilities = require('./utilities');

@@ -21,40 +22,43 @@

var MeydaAnalyzer = function () {
var MeydaAnalyzer = exports.MeydaAnalyzer = function () {
function MeydaAnalyzer(options, self) {
_classCallCheck(this, MeydaAnalyzer);
if (!options.audioContext) throw self._errors.noAC;else if (options.bufferSize && !utilities.isPowerOfTwo(options.bufferSize)) throw self._errors.notPow2;else if (!options.source) throw self._errors.noSource;
this._m = self;
if (!options.audioContext) throw this._m._errors.noAC;else if (options.bufferSize && !utilities.isPowerOfTwo(options.bufferSize)) throw this._m._errors.notPow2;else if (!options.source) throw this._m._errors.noSource;
self.audioContext = options.audioContext;
this._m.audioContext = options.audioContext;
// TODO: validate options
self.setSource(options.source);
self.bufferSize = options.bufferSize || self.bufferSize || 256;
self.sampleRate = options.sampleRate || self.audioContext.sampleRate || 44100;
self.callback = options.callback;
self.windowingFunction = options.windowingFunction || "hanning";
self.featureExtractors = featureExtractors;
self.EXTRACTION_STARTED = options.startImmediately || false;
this._m.bufferSize = options.bufferSize || self.bufferSize || 256;
this._m.sampleRate = options.sampleRate || this._m.audioContext.sampleRate || 44100;
this._m.callback = options.callback;
this._m.windowingFunction = options.windowingFunction || "hanning";
this._m.featureExtractors = featureExtractors;
this._m.EXTRACTION_STARTED = options.startImmediately || false;
//create nodes
self.spn = self.audioContext.createScriptProcessor(self.bufferSize, 1, 1);
self.spn.connect(self.audioContext.destination);
this._m.spn = this._m.audioContext.createScriptProcessor(this._m.bufferSize, 1, 1);
this._m.spn.connect(this._m.audioContext.destination);
self._featuresToExtract = options.featureExtractors || [];
this._m._featuresToExtract = options.featureExtractors || [];
//always recalculate BS and MFB when a new Meyda analyzer is created.
self.barkScale = utilities.createBarkScale(self.bufferSize, self.sampleRate, self.bufferSize);
self.melFilterBank = utilities.createMelFilterBank(self.melBands, self.sampleRate, self.bufferSize);
this._m.barkScale = utilities.createBarkScale(this._m.bufferSize, this._m.sampleRate, this._m.bufferSize);
this._m.melFilterBank = utilities.createMelFilterBank(this._m.melBands, this._m.sampleRate, this._m.bufferSize);
self.inputData = null;
this._m.inputData = null;
self.spn.onaudioprocess = function (e) {
// self is to obtain the current frame pcm data
self.inputData = e.inputBuffer.getChannelData(0);
self = this;
var features = self.extract(self._featuresToExtract, self.inputData);
this.setSource(options.source);
this._m.spn.onaudioprocess = function (e) {
self._m.inputData = e.inputBuffer.getChannelData(0);
var features = self._m.extract(self._m._featuresToExtract, self._m.inputData);
// call callback if applicable
if (typeof self.callback === "function" && self.EXTRACTION_STARTED) {
self.callback(features);
if (typeof self._m.callback === "function" && self._m.EXTRACTION_STARTED) {
self._m.callback(features);
}

@@ -67,4 +71,4 @@ };

value: function start(features) {
self._featuresToExtract = features;
self.EXTRACTION_STARTED = true;
this._m._featuresToExtract = features;
this._m.EXTRACTION_STARTED = true;
}

@@ -74,3 +78,3 @@ }, {

value: function stop() {
self.EXTRACTION_STARTED = false;
this._m.EXTRACTION_STARTED = false;
}

@@ -80,3 +84,3 @@ }, {

value: function setSource(source) {
source.connect(this.spn);
source.connect(this._m.spn);
}

@@ -86,4 +90,4 @@ }, {

value: function get(features) {
if (self.inputData !== null) {
return self.extract(features || self._featuresToExtract, self.inputData);
if (this._m.inputData !== null) {
return this._m.extract(features || this._m._featuresToExtract, this._m.inputData);
} else {

@@ -96,5 +100,2 @@ return null;

return MeydaAnalyzer;
}();
exports.default = MeydaAnalyzer;
module.exports = exports['default'];
}();

@@ -1,2 +0,2 @@

!function t(e,r,n){function o(i,u){if(!r[i]){if(!e[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(a)return a(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var s=r[i]={exports:{}};e[i][0].call(s.exports,function(t){var r=e[i][1][t];return o(r?r:t)},s,s.exports,t,e,r,n)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(t,e,r){function n(t,e){return y.isUndefined(e)?""+e:y.isNumber(e)&&!isFinite(e)?e.toString():y.isFunction(e)||y.isRegExp(e)?e.toString():e}function o(t,e){return y.isString(t)?t.length<e?t:t.slice(0,e):t}function a(t){return o(JSON.stringify(t.actual,n),128)+" "+t.operator+" "+o(JSON.stringify(t.expected,n),128)}function i(t,e,r,n,o){throw new d.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:o})}function u(t,e){t||i(t,!0,e,"==",d.ok)}function c(t,e){if(t===e)return!0;if(y.isBuffer(t)&&y.isBuffer(e)){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return y.isDate(t)&&y.isDate(e)?t.getTime()===e.getTime():y.isRegExp(t)&&y.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:y.isObject(t)||y.isObject(e)?s(t,e):t==e}function f(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function s(t,e){if(y.isNullOrUndefined(t)||y.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(y.isPrimitive(t)||y.isPrimitive(e))return t===e;var r=f(t),n=f(e);if(r&&!n||!r&&n)return!1;if(r)return t=m.call(t),e=m.call(e),c(t,e);var o,a,i=g(t),u=g(e);if(i.length!=u.length)return!1;for(i.sort(),u.sort(),a=i.length-1;a>=0;a--)if(i[a]!=u[a])return!1;for(a=i.length-1;a>=0;a--)if(o=i[a],!c(t[o],e[o]))return!1;return!0}function l(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function p(t,e,r,n){var o;y.isString(r)&&(n=r,r=null);try{e()}catch(a){o=a}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!o&&i(o,r,"Missing expected exception"+n),!t&&l(o,r)&&i(o,r,"Got unwanted exception"+n),t&&o&&r&&!l(o,r)||!t&&o)throw o}var y=t("util/"),m=Array.prototype.slice,h=Object.prototype.hasOwnProperty,d=e.exports=u;d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=a(this),this.generatedMessage=!0);var e=t.stackStartFunction||i;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,o=e.name,u=n.indexOf("\n"+o);if(u>=0){var c=n.indexOf("\n",u+1);n=n.substring(c+1)}this.stack=n}}},y.inherits(d.AssertionError,Error),d.fail=i,d.ok=u,d.equal=function(t,e,r){t!=e&&i(t,e,r,"==",d.equal)},d.notEqual=function(t,e,r){t==e&&i(t,e,r,"!=",d.notEqual)},d.deepEqual=function(t,e,r){c(t,e)||i(t,e,r,"deepEqual",d.deepEqual)},d.notDeepEqual=function(t,e,r){c(t,e)&&i(t,e,r,"notDeepEqual",d.notDeepEqual)},d.strictEqual=function(t,e,r){t!==e&&i(t,e,r,"===",d.strictEqual)},d.notStrictEqual=function(t,e,r){t===e&&i(t,e,r,"!==",d.notStrictEqual)},d["throws"]=function(t,e,r){p.apply(this,[!0].concat(m.call(arguments)))},d.doesNotThrow=function(t,e){p.apply(this,[!1].concat(m.call(arguments)))},d.ifError=function(t){if(t)throw t};var g=Object.keys||function(t){var e=[];for(var r in t)h.call(t,r)&&e.push(r);return e}},{"util/":9}],2:[function(t,e,r){e.exports=t("./src/dct.js")},{"./src/dct.js":3}],3:[function(t,e,r){function n(t,e){var r=t.length;e=e||2,cosMap&&cosMap[r]||o(r);var n=t.map(function(){return 0});return n.map(function(n,o){return e*t.reduce(function(t,e,n,a){return t+e*cosMap[r][n+o*r]},0)})}cosMap=null;var o=function(t){cosMap=cosMap||{},cosMap[t]=new Array(t*t);for(var e=Math.PI/t,r=0;t>r;r++)for(var n=0;t>n;n++)cosMap[t][n+r*t]=Math.cos(e*(n+.5)*r)};e.exports=n},{}],4:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],5:[function(t,e,r){"use strict";!function(t,e){function r(t){return t.forEach||(t.forEach=function(t){var e,r=this.length;for(e=0;r>e;e++)t(this[e],e,r)}),t}var n,o,a=Float32Array,i=Math.sqrt,u=function(t){return Math.pow(t,2)};t.isComplexArray=n=function(t){return t!==e&&t.hasOwnProperty!==e&&t.hasOwnProperty("real")&&t.hasOwnProperty("imag")},t.ComplexArray=o=function(t,e){n(t)?(this.ArrayType=t.ArrayType,this.real=new this.ArrayType(t.real),this.imag=new this.ArrayType(t.imag)):(this.ArrayType=e||a,this.real=new this.ArrayType(t),this.imag=new this.ArrayType(this.real.length)),this.length=this.real.length},o.prototype.toString=function(){var t=[];return this.forEach(function(e,r){t.push("("+e.real.toFixed(2)+","+e.imag.toFixed(2)+")")}),"["+t.join(",")+"]"},o.prototype.map=function(t){var e,r=this.length,n={};for(e=0;r>e;e++)n.real=this.real[e],n.imag=this.imag[e],t(n,e,r),this.real[e]=n.real,this.imag[e]=n.imag;return this},o.prototype.forEach=function(t){var e,r=this.length,n={};for(e=0;r>e;e++)n.real=this.real[e],n.imag=this.imag[e],t(n,e,r)},o.prototype.conjugate=function(){return new o(this).map(function(t){t.imag*=-1})},o.prototype.magnitude=function(){var t=new this.ArrayType(this.length);return this.forEach(function(e,r){t[r]=i(u(e.real)+u(e.imag))}),r(t)}}("undefined"==typeof r&&(this.complex_array={})||r)},{}],6:[function(t,e,r){"use strict";!function(t,e){function r(t){return e.isComplexArray(t)&&t||new f(t)}function n(t,e){var r=t.length;return r&r-1?o(t,e):a(t,e)}function o(t,e){var r,o,a,i,u,l,h,d,g,b,S,v,w,x,M=t.length;if(1===M)return t;for(a=new f(M,t.ArrayType),d=c(M),g=M/d,b=1/p(d),S=new f(g,t.ArrayType),o=0;d>o;o++){for(r=0;g>r;r++)S.real[r]=t.real[r*d+o],S.imag[r]=t.imag[r*d+o];for(g>1&&(S=n(S,e)),l=y(2*s*o/M),h=(e?-1:1)*m(2*s*o/M),i=1,u=0,r=0;M>r;r++)w=S.real[r%g],x=S.imag[r%g],a.real[r]+=i*w-u*x,a.imag[r]+=i*x+u*w,v=i*l-u*h,u=i*h+u*l,i=v}for(r=0;M>r;r++)t.real[r]=b*a.real[r],t.imag[r]=b*a.imag[r];return t}function a(t,e){var r,n,o,a,i,c,f,p,h,d,g,b,S,v,w,x,M,_=t.length;for(o=u(t),a=o.real,i=o.imag,M=1;_>M;){for(p=y(s/M),h=(e?-1:1)*m(s/M),r=0;_/(2*M)>r;r++)for(c=1,f=0,n=0;M>n;n++)g=2*r*M+n,b=g+M,S=a[g],v=i[g],w=c*a[b]-f*i[b],x=f*a[b]+c*i[b],a[g]=l*(S+w),i[g]=l*(v+x),a[b]=l*(S-w),i[b]=l*(v-x),d=c*p-f*h,f=c*h+f*p,c=d;M<<=1}return o}function i(t,e){for(var r=0;e>1;)r<<=1,r+=1&t,t>>=1,e>>=1;return r}function u(t){var e,r,n=t.length,o={};for(r=0;n>r;r++){var a=i(r,n);o.hasOwnProperty(r)||o.hasOwnProperty(a)||(e=t.real[a],t.real[a]=t.real[r],t.real[r]=e,e=t.imag[a],t.imag[a]=t.imag[r],t.imag[r]=e,o[r]=o[a]=!0)}return t}function c(t){for(var e=3,r=p(t);r>=e;){if(t%e===0)return e;e+=2}return t}var f=e.ComplexArray,s=Math.PI,l=Math.SQRT1_2,p=Math.sqrt,y=Math.cos,m=Math.sin;f.prototype.FFT=function(){return n(this,!1)},t.FFT=function(t){return r(t).FFT()},f.prototype.InvFFT=function(){return n(this,!0)},t.InvFFT=function(t){return r(t).InvFFT()},f.prototype.frequencyMap=function(t){return this.FFT().map(t).InvFFT()},t.frequencyMap=function(t,e){return r(t).frequencyMap(e)}}("undefined"==typeof r&&(this.fft={})||r,"undefined"==typeof t&&this.complex_array||t("./complex_array"))},{"./complex_array":5}],7:[function(t,e,r){function n(){s=!1,u.length?f=u.concat(f):l=-1,f.length&&o()}function o(){if(!s){var t=setTimeout(n);s=!0;for(var e=f.length;e;){for(u=f,f=[];++l<e;)u&&u[l].run();l=-1,e=f.length}u=null,s=!1,clearTimeout(t)}}function a(t,e){this.fun=t,this.array=e}function i(){}var u,c=e.exports={},f=[],s=!1,l=-1;c.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new a(t,e)),1!==f.length||s||setTimeout(o,0)},a.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=i,c.addListener=i,c.once=i,c.off=i,c.removeListener=i,c.removeAllListeners=i,c.emit=i,c.binding=function(t){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(t){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},{}],8:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],9:[function(t,e,r){(function(e,n){function o(t,e){var n={seen:[],stylize:i};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(e)?n.showHidden=e:e&&r._extend(n,e),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),c(n,t,n.depth)}function a(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function i(t,e){return t}function u(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function c(t,e,n){if(t.customInspect&&e&&j(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var o=e.inspect(n,t);return S(o)||(o=c(t,o,n)),o}var a=f(t,e);if(a)return a;var i=Object.keys(e),h=u(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(e)),E(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return s(e);if(0===i.length){if(j(e)){var d=e.name?": "+e.name:"";return t.stylize("[Function"+d+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(E(e))return s(e)}var g="",b=!1,v=["{","}"];if(m(e)&&(b=!0,v=["[","]"]),j(e)){var w=e.name?": "+e.name:"";g=" [Function"+w+"]"}if(x(e)&&(g=" "+RegExp.prototype.toString.call(e)),_(e)&&(g=" "+Date.prototype.toUTCString.call(e)),E(e)&&(g=" "+s(e)),0===i.length&&(!b||0==e.length))return v[0]+g+v[1];if(0>n)return x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var M;return M=b?l(t,e,n,h,i):i.map(function(r){return p(t,e,n,h,r,b)}),t.seen.pop(),y(M,g,v)}function f(t,e){if(w(e))return t.stylize("undefined","undefined");if(S(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):h(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0}function s(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,r,n,o){for(var a=[],i=0,u=e.length;u>i;++i)k(e,String(i))?a.push(p(t,e,r,n,String(i),!0)):a.push("");return o.forEach(function(o){o.match(/^\d+$/)||a.push(p(t,e,r,n,o,!0))}),a}function p(t,e,r,n,o,a){var i,u,f;if(f=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]},f.get?u=f.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):f.set&&(u=t.stylize("[Setter]","special")),k(n,o)||(i="["+o+"]"),u||(t.seen.indexOf(f.value)<0?(u=d(r)?c(t,f.value,null):c(t,f.value,r-1),u.indexOf("\n")>-1&&(u=a?u.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+u.split("\n").map(function(t){return" "+t}).join("\n"))):u=t.stylize("[Circular]","special")),w(i)){if(a&&o.match(/^\d+$/))return u;i=JSON.stringify(""+o),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+u}function y(t,e,r){var n=0,o=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function m(t){return Array.isArray(t)}function h(t){return"boolean"==typeof t}function d(t){return null===t}function g(t){return null==t}function b(t){return"number"==typeof t}function S(t){return"string"==typeof t}function v(t){return"symbol"==typeof t}function w(t){return void 0===t}function x(t){return M(t)&&"[object RegExp]"===T(t)}function M(t){return"object"==typeof t&&null!==t}function _(t){return M(t)&&"[object Date]"===T(t)}function E(t){return M(t)&&("[object Error]"===T(t)||t instanceof Error)}function j(t){return"function"==typeof t}function O(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function T(t){return Object.prototype.toString.call(t)}function F(t){return 10>t?"0"+t.toString(10):t.toString(10)}function A(){var t=new Date,e=[F(t.getHours()),F(t.getMinutes()),F(t.getSeconds())].join(":");return[t.getDate(),C[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var z=/%[sdj%]/g;r.format=function(t){if(!S(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(o(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,a=n.length,i=String(t).replace(z,function(t){if("%%"===t)return"%";if(r>=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),u=n[r];a>r;u=n[++r])i+=d(u)||!M(u)?" "+u:" "+o(u);return i},r.deprecate=function(t,o){function a(){if(!i){if(e.throwDeprecation)throw new Error(o);e.traceDeprecation?console.trace(o):console.error(o),i=!0}return t.apply(this,arguments)}if(w(n.process))return function(){return r.deprecate(t,o).apply(this,arguments)};if(e.noDeprecation===!0)return t;var i=!1;return a};var P,R={};r.debuglog=function(t){if(w(P)&&(P=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!R[t])if(new RegExp("\\b"+t+"\\b","i").test(P)){var n=e.pid;R[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else R[t]=function(){};return R[t]},r.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=m,r.isBoolean=h,r.isNull=d,r.isNullOrUndefined=g,r.isNumber=b,r.isString=S,r.isSymbol=v,r.isUndefined=w,r.isRegExp=x,r.isObject=M,r.isDate=_,r.isError=E,r.isFunction=j,r.isPrimitive=O,r.isBuffer=t("./support/isBuffer");var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",A(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!M(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":8,_process:7,inherits:4}],10:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==o(arguments[0].signal))throw new TypeError;for(var t=0,e=0;e<arguments[0].signal.length;e++)t+=Math.pow(Math.abs(arguments[0].signal[e]),2);return t};var a=t("assert");n(a);e.exports=r["default"]},{assert:1}],11:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0,o=0;o<e.length;o++)r+=Math.pow(o,t)*Math.abs(e[o]),n+=e[o];return r/n}Object.defineProperty(r,"__esModule",{value:!0}),r.mu=n},{}],12:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(t){if("object"!==n(t.ampSpectrum)||"object"!==n(t.barkScale))throw new TypeError;var e=24,r=new Float32Array(e),o=0,a=t.ampSpectrum,i=new Int32Array(e+1);i[0]=0;for(var u=t.barkScale[a.length-1]/e,c=1,f=0;f<a.length;f++)for(;t.barkScale[f]>u;)i[c++]=f,u=c*t.barkScale[a.length-1]/e;i[e]=a.length-1;for(var f=0;e>f;f++){for(var s=0,l=i[f];l<i[f+1];l++)s+=a[l];r[f]=Math.pow(s,.23)}for(var f=0;f<r.length;f++)o+=r[f];return{specific:r,total:o}},e.exports=r["default"]},{}],13:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(t){if("object"!==o(t.ampSpectrum)||"object"!==o(t.melFilterBank))throw new TypeError;for(var e=(0,i["default"])(t),r=t.melFilterBank.length,n=Array(r),a=new Float32Array(r),u=0;u<a.length;u++){n[u]=new Float32Array(t.bufferSize/2),a[u]=0;for(var f=0;f<t.bufferSize/2;f++)n[u][f]=t.melFilterBank[u][f]*e[f],a[u]+=n[u][f];a[u]=a[u]>1e-5?Math.log(a[u]):0}var s=Array.prototype.slice.call(a),l=c(s),p=new Float32Array(l);return p};var a=t("./powerSpectrum"),i=n(a),u=t("./../utilities"),c=(n(u),t("dct"));e.exports=r["default"]},{"./../utilities":29,"./powerSpectrum":16,dct:2}],14:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==o(arguments[0].signal))throw new TypeError;for(var t=(0,i["default"])(arguments[0]),e=t.specific,r=0,n=0;n<e.length;n++)r+=15>n?(n+1)*e[n+1]:.066*Math.exp(.171*(n+1));return r*=.11/t.total};var a=t("./loudness"),i=n(a);e.exports=r["default"]},{"./loudness":12}],15:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==o(arguments[0].signal))throw new TypeError;for(var t=(0,i["default"])(arguments[0]),e=0,r=0;r<t.specific.length;r++)t.specific[r]>e&&(e=t.specific[r]);var n=Math.pow((t.total-e)/t.total,2);return n};var a=t("./loudness"),i=n(a);e.exports=r["default"]},{"./loudness":12}],16:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;for(var t=new Float32Array(arguments[0].ampSpectrum.length),e=0;e<t.length;e++)t[e]=Math.pow(arguments[0].ampSpectrum[e],2);return t},e.exports=r["default"]},{}],17:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(t){if("object"!==n(t.signal))throw new TypeError;for(var e=0,r=0;r<t.signal.length;r++)e+=Math.pow(t.signal[r],2);return e/=t.signal.length,e=Math.sqrt(e)},e.exports=r["default"]},{}],18:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;return(0,o.mu)(1,arguments[0].ampSpectrum)};var o=t("./extractorUtilities");e.exports=r["default"]},{"./extractorUtilities":11}],19:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;for(var t=0,e=0,r=0;r<arguments[0].ampSpectrum.length;r++)t+=Math.log(arguments[0].ampSpectrum[r]),e+=arguments[0].ampSpectrum[r];return Math.exp(t/arguments[0].ampSpectrum.length)*arguments[0].ampSpectrum.length/e},e.exports=r["default"]},{}],20:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;var t=arguments[0].ampSpectrum,e=(0,o.mu)(1,t),r=(0,o.mu)(2,t),a=(0,o.mu)(3,t),i=(0,o.mu)(4,t),u=-3*Math.pow(e,4)+6*e*r-4*e*a+i,c=Math.pow(Math.sqrt(r-Math.pow(e,2)),4);return u/c};var o=t("./extractorUtilities");e.exports=r["default"]},{"./extractorUtilities":11}],21:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;for(var t=arguments[0].ampSpectrum,e=arguments[0].sampleRate/(2*(t.length-1)),r=0,o=0;o<t.length;o++)r+=t[o];for(var a=.99*r,i=t.length-1;r>a&&i>=0;)r-=t[i],--i;return(i+1)*e},e.exports=r["default"]},{}],22:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(t){if("object"!==n(t.ampSpectrum))throw new TypeError;var e=(0,o.mu)(1,t.ampSpectrum),r=(0,o.mu)(2,t.ampSpectrum),a=(0,o.mu)(3,t.ampSpectrum),i=2*Math.pow(e,3)-3*e*r+a,u=Math.pow(Math.sqrt(r-Math.pow(e,2)),3);return i/u};var o=t("./extractorUtilities");e.exports=r["default"]},{"./extractorUtilities":11}],23:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(t){if("object"!==n(t.ampSpectrum))throw new TypeError;for(var e=0,r=0,o=new Float32Array(t.ampSpectrum.length),a=0,i=0,u=0;u<t.ampSpectrum.length;u++){e+=t.ampSpectrum[u];var c=u*t.sampleRate/t.bufferSize;o[u]=c,a+=c*c,r+=c,i+=c*t.ampSpectrum[u]}return(t.ampSpectrum.length*i-r*e)/(e*(a-Math.pow(r,2)))},e.exports=r["default"]},{}],24:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(t){if("object"!==n(t.ampSpectrum))throw new TypeError;return Math.sqrt((0,o.mu)(2,t.ampSpectrum)-Math.pow((0,o.mu)(1,t.ampSpectrum),2))};var o=t("./extractorUtilities");e.exports=r["default"]},{"./extractorUtilities":11}],25:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!==n(arguments[0].signal))throw new TypeError;for(var t=0,e=0;e<arguments[0].signal.length;e++)(arguments[0].signal[e]>=0&&arguments[0].signal[e+1]<0||arguments[0].signal[e]<0&&arguments[0].signal[e+1]>=0)&&t++;return t},e.exports=r["default"]},{}],26:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(r,"__esModule",{value:!0});var o=t("./extractors/rms"),a=n(o),i=t("./extractors/energy"),u=n(i),c=t("./extractors/spectralSlope"),f=n(c),s=t("./extractors/spectralCentroid"),l=n(s),p=t("./extractors/spectralRolloff"),y=n(p),m=t("./extractors/spectralFlatness"),h=n(m),d=t("./extractors/spectralSpread"),g=n(d),b=t("./extractors/spectralSkewness"),S=n(b),v=t("./extractors/spectralKurtosis"),w=n(v),x=t("./extractors/zcr"),M=n(x),_=t("./extractors/loudness"),E=n(_),j=t("./extractors/perceptualSpread"),O=n(j),T=t("./extractors/perceptualSharpness"),F=n(T),A=t("./extractors/mfcc"),k=n(A),z=t("./extractors/powerSpectrum"),P=n(z);r["default"]={buffer:function(t){return t.signal},rms:a["default"],energy:u["default"],complexSpectrum:function(t){return t.complexSpectrum},spectralSlope:f["default"],spectralCentroid:l["default"],spectralRolloff:y["default"],spectralFlatness:h["default"],spectralSpread:g["default"],spectralSkewness:S["default"],spectralKurtosis:w["default"],amplitudeSpectrum:function(t){return t.ampSpectrum},zcr:M["default"],loudness:E["default"],perceptualSpread:O["default"],perceptualSharpness:F["default"],powerSpectrum:P["default"],mfcc:k["default"]},e.exports=r["default"]},{"./extractors/energy":10,"./extractors/loudness":12,"./extractors/mfcc":13,"./extractors/perceptualSharpness":14,"./extractors/perceptualSpread":15,"./extractors/powerSpectrum":16,"./extractors/rms":17,"./extractors/spectralCentroid":18,"./extractors/spectralFlatness":19,"./extractors/spectralKurtosis":20,"./extractors/spectralRolloff":21,"./extractors/spectralSkewness":22,"./extractors/spectralSlope":23,"./extractors/spectralSpread":24,"./extractors/zcr":25}],27:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};Object.defineProperty(r,"__esModule",{value:!0});var a=t("./utilities"),i=n(a),u=t("./featureExtractors"),c=n(u),f=t("jsfft"),s=(n(f),t("jsfft/lib/complex_array")),l=n(s),p=t("./meyda-wa"),y=n(p),m={audioContext:null,spn:null,bufferSize:512,sampleRate:44100,melBands:26,callback:null,windowingFunction:"hanning",featureExtractors:c,EXTRACTION_STARTED:!1,_featuresToExtract:[],_errors:{notPow2:new Error("Meyda: Input data length/buffer size needs to be a power of 2, e.g. 64 or 512"),featureUndef:new Error("Meyda: No features defined."),invalidFeatureFmt:new Error("Meyda: Invalid feature format"),invalidInput:new Error("Meyda: Invalid input."),noAC:new Error("Meyda: No AudioContext specified."),noSource:new Error("Meyda: No source node specified.")},createMeydaAnalyzer:function(t){return new y(t,this)},extract:function(t,e){if(!e)throw this._errors.invalidInput;if("object"!=("undefined"==typeof e?"undefined":o(e)))throw this._errors.invalidInput;if(!t)throw this._errors.featureUndef;if(!i.isPowerOfTwo(e.length))throw this._errors.notPow2;("undefined"==typeof this.barkScale||this.barkScale.length!=this.bufferSize)&&(this.barkScale=i.createBarkScale(this.bufferSize,this.sampleRate,this.bufferSize)),("undefined"==typeof this.melFilterBank||this.barkScale.length!=this.bufferSize||this.melFilterBank.length!=this.melBands)&&(this.melFilterBank=i.createMelFilterBank(this.melBands,this.sampleRate,this.bufferSize)),"undefined"==typeof e.buffer?this.signal=i.arrayToTyped(e):this.signal=e;var r=i.applyWindow(this.signal,this.windowingFunction),n=new l.ComplexArray(this.bufferSize);n.map(function(t,e,n){t.real=r[e]});var a=n.FFT();this.complexSpectrum=a,this.ampSpectrum=new Float32Array(this.bufferSize/2);for(var u=0;u<this.bufferSize/2;u++)this.ampSpectrum[u]=Math.sqrt(Math.pow(a.real[u],2)+Math.pow(a.imag[u],2));if("object"===("undefined"==typeof t?"undefined":o(t))){for(var c={},f=0;f<t.length;f++)c[t[f]]=this.featureExtractors[t[f]]({ampSpectrum:this.ampSpectrum,complexSpectrum:this.complexSpectrum,signal:this.signal,bufferSize:this.bufferSize,sampleRate:this.sampleRate,barkScale:this.barkScale,melFilterBank:this.melFilterBank});return c}if("string"==typeof t)return this.featureExtractors[t]({ampSpectrum:this.ampSpectrum,complexSpectrum:this.complexSpectrum,signal:this.signal,bufferSize:this.bufferSize,sampleRate:this.sampleRate,barkScale:this.barkScale,melFilterBank:this.melFilterBank});throw this._errors.invalidFeatureFmt}};r["default"]=m,"undefined"!=typeof window&&(window.Meyda=m),e.exports=r["default"]},{"./featureExtractors":26,"./meyda-wa":28,"./utilities":29,jsfft:6,"jsfft/lib/complex_array":5}],28:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();Object.defineProperty(r,"__esModule",{value:!0});var i=t("./utilities"),u=n(i),c=t("./featureExtractors"),f=n(c),s=function(){function t(e,r){if(o(this,t),!e.audioContext)throw r._errors.noAC;if(e.bufferSize&&!u.isPowerOfTwo(e.bufferSize))throw r._errors.notPow2;if(!e.source)throw r._errors.noSource;r.audioContext=e.audioContext,r.setSource(e.source),r.bufferSize=e.bufferSize||r.bufferSize||256,r.sampleRate=e.sampleRate||r.audioContext.sampleRate||44100,r.callback=e.callback,r.windowingFunction=e.windowingFunction||"hanning",r.featureExtractors=f,r.EXTRACTION_STARTED=e.startImmediately||!1,r.spn=r.audioContext.createScriptProcessor(r.bufferSize,1,1),r.spn.connect(r.audioContext.destination),r._featuresToExtract=e.featureExtractors||[],r.barkScale=u.createBarkScale(r.bufferSize,r.sampleRate,r.bufferSize),r.melFilterBank=u.createMelFilterBank(r.melBands,r.sampleRate,r.bufferSize),r.inputData=null,r.spn.onaudioprocess=function(t){r.inputData=t.inputBuffer.getChannelData(0);var e=r.extract(r._featuresToExtract,r.inputData);"function"==typeof r.callback&&r.EXTRACTION_STARTED&&r.callback(e)}}return a(t,[{key:"start",value:function(t){self._featuresToExtract=t,self.EXTRACTION_STARTED=!0}},{key:"stop",value:function(){self.EXTRACTION_STARTED=!1}},{key:"setSource",value:function(t){t.connect(this.spn)}},{key:"get",value:function(t){return null!==self.inputData?self.extract(t||self._featuresToExtract,self.inputData):null}}]),t}();r["default"]=s,e.exports=r["default"]},{"./featureExtractors":26,"./utilities":29}],29:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){for(;t%2===0&&t>1;)t/=2;return 1===t}function a(t){throw new Error("Meyda: "+t)}function i(t,e){for(var r=[],n=0;n<Math.min(t.length,e.length);n++)r[n]=t[n]*e[n];return r}function u(t,e){if("rect"!==e&&(""!==e&&e||(e="hanning"),x[e]||(x[e]={}),!x[e][t.length]))try{x[e][t.length]=w[e](t.length),t=i(t,x[e][t.length])}catch(r){throw new Error("Invalid windowing function")}return t}function c(t,e,r){for(var n=new Float32Array(t),o=0;o<n.length;o++)n[o]=o*e/r,n[o]=13*Math.atan(n[o]/1315.8)+3.5*Math.atan(Math.pow(n[o]/7518,2));return n}function f(t){return Array.prototype.slice.call(t)}function s(t){return Float32Array.from(t)}function l(t,e){return t/e}function p(t,e){return t.map(function(t){return t/e})}function y(t){var e=0;return t.forEach(function(t,r,n){
t>e&&(e=t)}),t.map(function(t){return t/e})}function m(t){return t.reduce(function(t,e){return t+e})/t.length}function h(t){var e=700*(Math.exp(t/1125)-1);return e}function d(t){var e=1125*Math.log(1+t/700);return e}function g(t){return h(t)}function b(t){return d(t)}function S(t,e,r){for(var n=new Float32Array(t+2),o=new Float32Array(t+2),a=0,i=e/2,u=d(a),c=d(i),f=c-u,s=f/(t+1),l=Array(t+2),p=0;p<n.length;p++)n[p]=p*s,o[p]=h(n[p]),l[p]=Math.floor((r+1)*o[p]/e);for(var y=Array(t),m=0;m<y.length;m++){y[m]=Array.apply(null,new Array(r/2+1)).map(Number.prototype.valueOf,0);for(var p=l[m];p<l[m+1];p++)y[m][p]=(p-l[m])/(l[m+1]-l[m]);for(var p=l[m+1];p<l[m+2];p++)y[m][p]=(l[m+2]-p)/(l[m+2]-l[m+1])}return y}Object.defineProperty(r,"__esModule",{value:!0}),r.isPowerOfTwo=o,r.error=a,r.pointwiseBufferMult=i,r.applyWindow=u,r.createBarkScale=c,r.typedToArray=f,r.arrayToTyped=s,r.normalize=l,r.normalize_a=p,r.normalize_a_to_1=y,r.mean=m,r.melToFreq=g,r.freqToMel=b,r.createMelFilterBank=S;var v=t("./windowing"),w=n(v),x={}},{"./windowing":30}],30:[function(t,e,r){"use strict";function n(t){for(var e=new Float32Array(t),r=2*Math.PI/(t-1),n=2*r,o=0;t/2>o;o++)e[o]=.42-.5*Math.cos(o*r)+.08*Math.cos(o*n);for(var o=t/2;o>0;o--)e[t-o]=e[o-1];return e}function o(t){for(var e=Math.PI/(t-1),r=new Float32Array(t),n=0;t>n;n++)r[n]=Math.sin(e*n);return r}function a(t){for(var e=new Float32Array(t),r=0;t>r;r++)e[r]=.5-.5*Math.cos(2*Math.PI*r/(t-1));return e}function i(t){for(var e=new Float32Array(t),r=0;t>r;r++)e[r]=.54-.46*Math.cos(2*Math.PI*(r/t-1));return e}Object.defineProperty(r,"__esModule",{value:!0}),r.blackman=n,r.sine=o,r.hanning=a,r.hamming=i},{}]},{},[27]);
!function t(e,r,n){function o(i,u){if(!r[i]){if(!e[i]){var s="function"==typeof require&&require;if(!u&&s)return s(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[i]={exports:{}};e[i][0].call(f.exports,function(t){var r=e[i][1][t];return o(r?r:t)},f,f.exports,t,e,r,n)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(t,e,r){function n(t,e){return m.isUndefined(e)?""+e:m.isNumber(e)&&!isFinite(e)?e.toString():m.isFunction(e)||m.isRegExp(e)?e.toString():e}function o(t,e){return m.isString(t)?t.length<e?t:t.slice(0,e):t}function a(t){return o(JSON.stringify(t.actual,n),128)+" "+t.operator+" "+o(JSON.stringify(t.expected,n),128)}function i(t,e,r,n,o){throw new d.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:o})}function u(t,e){t||i(t,!0,e,"==",d.ok)}function s(t,e){if(t===e)return!0;if(m.isBuffer(t)&&m.isBuffer(e)){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return m.isDate(t)&&m.isDate(e)?t.getTime()===e.getTime():m.isRegExp(t)&&m.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:m.isObject(t)||m.isObject(e)?f(t,e):t==e}function c(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function f(t,e){if(m.isNullOrUndefined(t)||m.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(m.isPrimitive(t)||m.isPrimitive(e))return t===e;var r=c(t),n=c(e);if(r&&!n||!r&&n)return!1;if(r)return t=y.call(t),e=y.call(e),s(t,e);var o,a,i=g(t),u=g(e);if(i.length!=u.length)return!1;for(i.sort(),u.sort(),a=i.length-1;a>=0;a--)if(i[a]!=u[a])return!1;for(a=i.length-1;a>=0;a--)if(o=i[a],!s(t[o],e[o]))return!1;return!0}function l(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function p(t,e,r,n){var o;m.isString(r)&&(n=r,r=null);try{e()}catch(a){o=a}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!o&&i(o,r,"Missing expected exception"+n),!t&&l(o,r)&&i(o,r,"Got unwanted exception"+n),t&&o&&r&&!l(o,r)||!t&&o)throw o}var m=t("util/"),y=Array.prototype.slice,h=Object.prototype.hasOwnProperty,d=e.exports=u;d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=a(this),this.generatedMessage=!0);var e=t.stackStartFunction||i;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,o=e.name,u=n.indexOf("\n"+o);if(u>=0){var s=n.indexOf("\n",u+1);n=n.substring(s+1)}this.stack=n}}},m.inherits(d.AssertionError,Error),d.fail=i,d.ok=u,d.equal=function(t,e,r){t!=e&&i(t,e,r,"==",d.equal)},d.notEqual=function(t,e,r){t==e&&i(t,e,r,"!=",d.notEqual)},d.deepEqual=function(t,e,r){s(t,e)||i(t,e,r,"deepEqual",d.deepEqual)},d.notDeepEqual=function(t,e,r){s(t,e)&&i(t,e,r,"notDeepEqual",d.notDeepEqual)},d.strictEqual=function(t,e,r){t!==e&&i(t,e,r,"===",d.strictEqual)},d.notStrictEqual=function(t,e,r){t===e&&i(t,e,r,"!==",d.notStrictEqual)},d["throws"]=function(t,e,r){p.apply(this,[!0].concat(y.call(arguments)))},d.doesNotThrow=function(t,e){p.apply(this,[!1].concat(y.call(arguments)))},d.ifError=function(t){if(t)throw t};var g=Object.keys||function(t){var e=[];for(var r in t)h.call(t,r)&&e.push(r);return e}},{"util/":9}],2:[function(t,e,r){e.exports=t("./src/dct.js")},{"./src/dct.js":3}],3:[function(t,e,r){function n(t,e){var r=t.length;e=e||2,cosMap&&cosMap[r]||o(r);var n=t.map(function(){return 0});return n.map(function(n,o){return e*t.reduce(function(t,e,n,a){return t+e*cosMap[r][n+o*r]},0)})}cosMap=null;var o=function(t){cosMap=cosMap||{},cosMap[t]=new Array(t*t);for(var e=Math.PI/t,r=0;t>r;r++)for(var n=0;t>n;n++)cosMap[t][n+r*t]=Math.cos(e*(n+.5)*r)};e.exports=n},{}],4:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],5:[function(t,e,r){"use strict";!function(t,e){function r(t){return t.forEach||(t.forEach=function(t){var e,r=this.length;for(e=0;r>e;e++)t(this[e],e,r)}),t}var n,o,a=Float32Array,i=Math.sqrt,u=function(t){return Math.pow(t,2)};t.isComplexArray=n=function(t){return t!==e&&t.hasOwnProperty!==e&&t.hasOwnProperty("real")&&t.hasOwnProperty("imag")},t.ComplexArray=o=function(t,e){n(t)?(this.ArrayType=t.ArrayType,this.real=new this.ArrayType(t.real),this.imag=new this.ArrayType(t.imag)):(this.ArrayType=e||a,this.real=new this.ArrayType(t),this.imag=new this.ArrayType(this.real.length)),this.length=this.real.length},o.prototype.toString=function(){var t=[];return this.forEach(function(e,r){t.push("("+e.real.toFixed(2)+","+e.imag.toFixed(2)+")")}),"["+t.join(",")+"]"},o.prototype.map=function(t){var e,r=this.length,n={};for(e=0;r>e;e++)n.real=this.real[e],n.imag=this.imag[e],t(n,e,r),this.real[e]=n.real,this.imag[e]=n.imag;return this},o.prototype.forEach=function(t){var e,r=this.length,n={};for(e=0;r>e;e++)n.real=this.real[e],n.imag=this.imag[e],t(n,e,r)},o.prototype.conjugate=function(){return new o(this).map(function(t){t.imag*=-1})},o.prototype.magnitude=function(){var t=new this.ArrayType(this.length);return this.forEach(function(e,r){t[r]=i(u(e.real)+u(e.imag))}),r(t)}}("undefined"==typeof r&&(this.complex_array={})||r)},{}],6:[function(t,e,r){"use strict";!function(t,e){function r(t){return e.isComplexArray(t)&&t||new c(t)}function n(t,e){var r=t.length;return r&r-1?o(t,e):a(t,e)}function o(t,e){var r,o,a,i,u,l,h,d,g,b,S,v,w,x,_=t.length;if(1===_)return t;for(a=new c(_,t.ArrayType),d=s(_),g=_/d,b=1/p(d),S=new c(g,t.ArrayType),o=0;d>o;o++){for(r=0;g>r;r++)S.real[r]=t.real[r*d+o],S.imag[r]=t.imag[r*d+o];for(g>1&&(S=n(S,e)),l=m(2*f*o/_),h=(e?-1:1)*y(2*f*o/_),i=1,u=0,r=0;_>r;r++)w=S.real[r%g],x=S.imag[r%g],a.real[r]+=i*w-u*x,a.imag[r]+=i*x+u*w,v=i*l-u*h,u=i*h+u*l,i=v}for(r=0;_>r;r++)t.real[r]=b*a.real[r],t.imag[r]=b*a.imag[r];return t}function a(t,e){var r,n,o,a,i,s,c,p,h,d,g,b,S,v,w,x,_,M=t.length;for(o=u(t),a=o.real,i=o.imag,_=1;M>_;){for(p=m(f/_),h=(e?-1:1)*y(f/_),r=0;M/(2*_)>r;r++)for(s=1,c=0,n=0;_>n;n++)g=2*r*_+n,b=g+_,S=a[g],v=i[g],w=s*a[b]-c*i[b],x=c*a[b]+s*i[b],a[g]=l*(S+w),i[g]=l*(v+x),a[b]=l*(S-w),i[b]=l*(v-x),d=s*p-c*h,c=s*h+c*p,s=d;_<<=1}return o}function i(t,e){for(var r=0;e>1;)r<<=1,r+=1&t,t>>=1,e>>=1;return r}function u(t){var e,r,n=t.length,o={};for(r=0;n>r;r++){var a=i(r,n);o.hasOwnProperty(r)||o.hasOwnProperty(a)||(e=t.real[a],t.real[a]=t.real[r],t.real[r]=e,e=t.imag[a],t.imag[a]=t.imag[r],t.imag[r]=e,o[r]=o[a]=!0)}return t}function s(t){for(var e=3,r=p(t);r>=e;){if(t%e===0)return e;e+=2}return t}var c=e.ComplexArray,f=Math.PI,l=Math.SQRT1_2,p=Math.sqrt,m=Math.cos,y=Math.sin;c.prototype.FFT=function(){return n(this,!1)},t.FFT=function(t){return r(t).FFT()},c.prototype.InvFFT=function(){return n(this,!0)},t.InvFFT=function(t){return r(t).InvFFT()},c.prototype.frequencyMap=function(t){return this.FFT().map(t).InvFFT()},t.frequencyMap=function(t,e){return r(t).frequencyMap(e)}}("undefined"==typeof r&&(this.fft={})||r,"undefined"==typeof t&&this.complex_array||t("./complex_array"))},{"./complex_array":5}],7:[function(t,e,r){function n(){f=!1,u.length?c=u.concat(c):l=-1,c.length&&o()}function o(){if(!f){var t=setTimeout(n);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l<e;)u&&u[l].run();l=-1,e=c.length}u=null,f=!1,clearTimeout(t)}}function a(t,e){this.fun=t,this.array=e}function i(){}var u,s=e.exports={},c=[],f=!1,l=-1;s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new a(t,e)),1!==c.length||f||setTimeout(o,0)},a.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=i,s.addListener=i,s.once=i,s.off=i,s.removeListener=i,s.removeAllListeners=i,s.emit=i,s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],8:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],9:[function(t,e,r){(function(e,n){function o(t,e){var n={seen:[],stylize:i};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(e)?n.showHidden=e:e&&r._extend(n,e),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,t,n.depth)}function a(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function i(t,e){return t}function u(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function s(t,e,n){if(t.customInspect&&e&&j(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var o=e.inspect(n,t);return S(o)||(o=s(t,o,n)),o}var a=c(t,e);if(a)return a;var i=Object.keys(e),h=u(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(e)),E(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return f(e);if(0===i.length){if(j(e)){var d=e.name?": "+e.name:"";return t.stylize("[Function"+d+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(M(e))return t.stylize(Date.prototype.toString.call(e),"date");if(E(e))return f(e)}var g="",b=!1,v=["{","}"];if(y(e)&&(b=!0,v=["[","]"]),j(e)){var w=e.name?": "+e.name:"";g=" [Function"+w+"]"}if(x(e)&&(g=" "+RegExp.prototype.toString.call(e)),M(e)&&(g=" "+Date.prototype.toUTCString.call(e)),E(e)&&(g=" "+f(e)),0===i.length&&(!b||0==e.length))return v[0]+g+v[1];if(0>n)return x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var _;return _=b?l(t,e,n,h,i):i.map(function(r){return p(t,e,n,h,r,b)}),t.seen.pop(),m(_,g,v)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(S(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):h(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,r,n,o){for(var a=[],i=0,u=e.length;u>i;++i)k(e,String(i))?a.push(p(t,e,r,n,String(i),!0)):a.push("");return o.forEach(function(o){o.match(/^\d+$/)||a.push(p(t,e,r,n,o,!0))}),a}function p(t,e,r,n,o,a){var i,u,c;if(c=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]},c.get?u=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(u=t.stylize("[Setter]","special")),k(n,o)||(i="["+o+"]"),u||(t.seen.indexOf(c.value)<0?(u=d(r)?s(t,c.value,null):s(t,c.value,r-1),u.indexOf("\n")>-1&&(u=a?u.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+u.split("\n").map(function(t){return" "+t}).join("\n"))):u=t.stylize("[Circular]","special")),w(i)){if(a&&o.match(/^\d+$/))return u;i=JSON.stringify(""+o),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+u}function m(t,e,r){var n=0,o=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function y(t){return Array.isArray(t)}function h(t){return"boolean"==typeof t}function d(t){return null===t}function g(t){return null==t}function b(t){return"number"==typeof t}function S(t){return"string"==typeof t}function v(t){return"symbol"==typeof t}function w(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===T(t)}function _(t){return"object"==typeof t&&null!==t}function M(t){return _(t)&&"[object Date]"===T(t)}function E(t){return _(t)&&("[object Error]"===T(t)||t instanceof Error)}function j(t){return"function"==typeof t}function O(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function T(t){return Object.prototype.toString.call(t)}function A(t){return 10>t?"0"+t.toString(10):t.toString(10)}function F(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),C[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var z=/%[sdj%]/g;r.format=function(t){if(!S(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(o(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,a=n.length,i=String(t).replace(z,function(t){if("%%"===t)return"%";if(r>=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),u=n[r];a>r;u=n[++r])i+=d(u)||!_(u)?" "+u:" "+o(u);return i},r.deprecate=function(t,o){function a(){if(!i){if(e.throwDeprecation)throw new Error(o);e.traceDeprecation?console.trace(o):console.error(o),i=!0}return t.apply(this,arguments)}if(w(n.process))return function(){return r.deprecate(t,o).apply(this,arguments)};if(e.noDeprecation===!0)return t;var i=!1;return a};var P,R={};r.debuglog=function(t){if(w(P)&&(P=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!R[t])if(new RegExp("\\b"+t+"\\b","i").test(P)){var n=e.pid;R[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else R[t]=function(){};return R[t]},r.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=y,r.isBoolean=h,r.isNull=d,r.isNullOrUndefined=g,r.isNumber=b,r.isString=S,r.isSymbol=v,r.isUndefined=w,r.isRegExp=x,r.isObject=_,r.isDate=M,r.isError=E,r.isFunction=j,r.isPrimitive=O,r.isBuffer=t("./support/isBuffer");var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",F(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":8,_process:7,inherits:4}],10:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}Object.defineProperty(r,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==o(arguments[0].signal))throw new TypeError;for(var t=0,e=0;e<arguments[0].signal.length;e++)t+=Math.pow(Math.abs(arguments[0].signal[e]),2);return t};var a=t("assert");n(a);e.exports=r["default"]},{assert:1}],11:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0,o=0;o<e.length;o++)r+=Math.pow(o,t)*Math.abs(e[o]),n+=e[o];return r/n}Object.defineProperty(r,"__esModule",{value:!0}),r.mu=n},{}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(t){if("object"!==n(t.ampSpectrum)||"object"!==n(t.barkScale))throw new TypeError;var e=24,r=new Float32Array(e),o=0,a=t.ampSpectrum,i=new Int32Array(e+1);i[0]=0;for(var u=t.barkScale[a.length-1]/e,s=1,c=0;c<a.length;c++)for(;t.barkScale[c]>u;)i[s++]=c,u=s*t.barkScale[a.length-1]/e;i[e]=a.length-1;for(var c=0;e>c;c++){for(var f=0,l=i[c];l<i[c+1];l++)f+=a[l];r[c]=Math.pow(f,.23)}for(var c=0;c<r.length;c++)o+=r[c];return{specific:r,total:o}},e.exports=r["default"]},{}],13:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(r,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(t){if("object"!==o(t.ampSpectrum)||"object"!==o(t.melFilterBank))throw new TypeError;for(var e=(0,i["default"])(t),r=t.melFilterBank.length,n=Array(r),a=new Float32Array(r),u=0;u<a.length;u++){n[u]=new Float32Array(t.bufferSize/2),a[u]=0;for(var c=0;c<t.bufferSize/2;c++)n[u][c]=t.melFilterBank[u][c]*e[c],a[u]+=n[u][c];a[u]=a[u]>1e-5?Math.log(a[u]):0}var f=Array.prototype.slice.call(a),l=s(f),p=new Float32Array(l);return p};var a=t("./powerSpectrum"),i=n(a),u=t("./../utilities"),s=(n(u),t("dct"));e.exports=r["default"]},{"./../utilities":29,"./powerSpectrum":16,dct:2}],14:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(r,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==o(arguments[0].signal))throw new TypeError;for(var t=(0,i["default"])(arguments[0]),e=t.specific,r=0,n=0;n<e.length;n++)r+=15>n?(n+1)*e[n+1]:.066*Math.exp(.171*(n+1));return r*=.11/t.total};var a=t("./loudness"),i=n(a);e.exports=r["default"]},{"./loudness":12}],15:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(r,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==o(arguments[0].signal))throw new TypeError;for(var t=(0,i["default"])(arguments[0]),e=0,r=0;r<t.specific.length;r++)t.specific[r]>e&&(e=t.specific[r]);var n=Math.pow((t.total-e)/t.total,2);return n};var a=t("./loudness"),i=n(a);e.exports=r["default"]},{"./loudness":12}],16:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;for(var t=new Float32Array(arguments[0].ampSpectrum.length),e=0;e<t.length;e++)t[e]=Math.pow(arguments[0].ampSpectrum[e],2);return t},e.exports=r["default"]},{}],17:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(t){if("object"!==n(t.signal))throw new TypeError;for(var e=0,r=0;r<t.signal.length;r++)e+=Math.pow(t.signal[r],2);return e/=t.signal.length,e=Math.sqrt(e)},e.exports=r["default"]},{}],18:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;return(0,o.mu)(1,arguments[0].ampSpectrum)};var o=t("./extractorUtilities");e.exports=r["default"]},{"./extractorUtilities":11}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;for(var t=0,e=0,r=0;r<arguments[0].ampSpectrum.length;r++)t+=Math.log(arguments[0].ampSpectrum[r]),e+=arguments[0].ampSpectrum[r];return Math.exp(t/arguments[0].ampSpectrum.length)*arguments[0].ampSpectrum.length/e},e.exports=r["default"]},{}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;var t=arguments[0].ampSpectrum,e=(0,o.mu)(1,t),r=(0,o.mu)(2,t),a=(0,o.mu)(3,t),i=(0,o.mu)(4,t),u=-3*Math.pow(e,4)+6*e*r-4*e*a+i,s=Math.pow(Math.sqrt(r-Math.pow(e,2)),4);return u/s};var o=t("./extractorUtilities");e.exports=r["default"]},{"./extractorUtilities":11}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==n(arguments[0].ampSpectrum))throw new TypeError;for(var t=arguments[0].ampSpectrum,e=arguments[0].sampleRate/(2*(t.length-1)),r=0,o=0;o<t.length;o++)r+=t[o];for(var a=.99*r,i=t.length-1;r>a&&i>=0;)r-=t[i],--i;return(i+1)*e},e.exports=r["default"]},{}],22:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(t){if("object"!==n(t.ampSpectrum))throw new TypeError;var e=(0,o.mu)(1,t.ampSpectrum),r=(0,o.mu)(2,t.ampSpectrum),a=(0,o.mu)(3,t.ampSpectrum),i=2*Math.pow(e,3)-3*e*r+a,u=Math.pow(Math.sqrt(r-Math.pow(e,2)),3);return i/u};var o=t("./extractorUtilities");e.exports=r["default"]},{"./extractorUtilities":11}],23:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(t){if("object"!==n(t.ampSpectrum))throw new TypeError;for(var e=0,r=0,o=new Float32Array(t.ampSpectrum.length),a=0,i=0,u=0;u<t.ampSpectrum.length;u++){e+=t.ampSpectrum[u];var s=u*t.sampleRate/t.bufferSize;o[u]=s,a+=s*s,r+=s,i+=s*t.ampSpectrum[u]}return(t.ampSpectrum.length*i-r*e)/(e*(a-Math.pow(r,2)))},e.exports=r["default"]},{}],24:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(t){if("object"!==n(t.ampSpectrum))throw new TypeError;return Math.sqrt((0,o.mu)(2,t.ampSpectrum)-Math.pow((0,o.mu)(1,t.ampSpectrum),2))};var o=t("./extractorUtilities");e.exports=r["default"]},{"./extractorUtilities":11}],25:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r["default"]=function(){if("object"!==n(arguments[0].signal))throw new TypeError;for(var t=0,e=0;e<arguments[0].signal.length;e++)(arguments[0].signal[e]>=0&&arguments[0].signal[e+1]<0||arguments[0].signal[e]<0&&arguments[0].signal[e+1]>=0)&&t++;return t},e.exports=r["default"]},{}],26:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(r,"__esModule",{value:!0});var o=t("./extractors/rms"),a=n(o),i=t("./extractors/energy"),u=n(i),s=t("./extractors/spectralSlope"),c=n(s),f=t("./extractors/spectralCentroid"),l=n(f),p=t("./extractors/spectralRolloff"),m=n(p),y=t("./extractors/spectralFlatness"),h=n(y),d=t("./extractors/spectralSpread"),g=n(d),b=t("./extractors/spectralSkewness"),S=n(b),v=t("./extractors/spectralKurtosis"),w=n(v),x=t("./extractors/zcr"),_=n(x),M=t("./extractors/loudness"),E=n(M),j=t("./extractors/perceptualSpread"),O=n(j),T=t("./extractors/perceptualSharpness"),A=n(T),F=t("./extractors/mfcc"),k=n(F),z=t("./extractors/powerSpectrum"),P=n(z);r["default"]={buffer:function(t){return t.signal},rms:a["default"],energy:u["default"],complexSpectrum:function(t){return t.complexSpectrum},spectralSlope:c["default"],spectralCentroid:l["default"],spectralRolloff:m["default"],spectralFlatness:h["default"],spectralSpread:g["default"],spectralSkewness:S["default"],spectralKurtosis:w["default"],amplitudeSpectrum:function(t){return t.ampSpectrum},zcr:_["default"],loudness:E["default"],perceptualSpread:O["default"],perceptualSharpness:A["default"],powerSpectrum:P["default"],mfcc:k["default"]},e.exports=r["default"]},{"./extractors/energy":10,"./extractors/loudness":12,"./extractors/mfcc":13,"./extractors/perceptualSharpness":14,"./extractors/perceptualSpread":15,"./extractors/powerSpectrum":16,"./extractors/rms":17,"./extractors/spectralCentroid":18,"./extractors/spectralFlatness":19,"./extractors/spectralKurtosis":20,"./extractors/spectralRolloff":21,"./extractors/spectralSkewness":22,"./extractors/spectralSlope":23,"./extractors/spectralSpread":24,"./extractors/zcr":25}],27:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}Object.defineProperty(r,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=t("./utilities"),i=n(a),u=t("./featureExtractors"),s=n(u),c=t("jsfft"),f=(n(c),t("jsfft/lib/complex_array")),l=n(f),p=t("./meyda-wa"),m={audioContext:null,spn:null,bufferSize:512,sampleRate:44100,melBands:26,callback:null,windowingFunction:"hanning",featureExtractors:s,EXTRACTION_STARTED:!1,_featuresToExtract:[],_errors:{notPow2:new Error("Meyda: Input data length/buffer size needs to be a power of 2, e.g. 64 or 512"),featureUndef:new Error("Meyda: No features defined."),invalidFeatureFmt:new Error("Meyda: Invalid feature format"),invalidInput:new Error("Meyda: Invalid input."),noAC:new Error("Meyda: No AudioContext specified."),noSource:new Error("Meyda: No source node specified.")},createMeydaAnalyzer:function(t){return new p.MeydaAnalyzer(t,this)},extract:function(t,e){if(!e)throw this._errors.invalidInput;if("object"!=("undefined"==typeof e?"undefined":o(e)))throw this._errors.invalidInput;if(!t)throw this._errors.featureUndef;if(!i.isPowerOfTwo(e.length))throw this._errors.notPow2;("undefined"==typeof this.barkScale||this.barkScale.length!=this.bufferSize)&&(this.barkScale=i.createBarkScale(this.bufferSize,this.sampleRate,this.bufferSize)),("undefined"==typeof this.melFilterBank||this.barkScale.length!=this.bufferSize||this.melFilterBank.length!=this.melBands)&&(this.melFilterBank=i.createMelFilterBank(this.melBands,this.sampleRate,this.bufferSize)),"undefined"==typeof e.buffer?this.signal=i.arrayToTyped(e):this.signal=e;var r=i.applyWindow(this.signal,this.windowingFunction),n=new l.ComplexArray(this.bufferSize);n.map(function(t,e,n){t.real=r[e]});var a=n.FFT();this.complexSpectrum=a,this.ampSpectrum=new Float32Array(this.bufferSize/2);for(var u=0;u<this.bufferSize/2;u++)this.ampSpectrum[u]=Math.sqrt(Math.pow(a.real[u],2)+Math.pow(a.imag[u],2));if("object"===("undefined"==typeof t?"undefined":o(t))){for(var s={},c=0;c<t.length;c++)s[t[c]]=this.featureExtractors[t[c]]({ampSpectrum:this.ampSpectrum,complexSpectrum:this.complexSpectrum,signal:this.signal,bufferSize:this.bufferSize,sampleRate:this.sampleRate,barkScale:this.barkScale,melFilterBank:this.melFilterBank});return s}if("string"==typeof t)return this.featureExtractors[t]({ampSpectrum:this.ampSpectrum,complexSpectrum:this.complexSpectrum,signal:this.signal,bufferSize:this.bufferSize,sampleRate:this.sampleRate,barkScale:this.barkScale,melFilterBank:this.melFilterBank});throw this._errors.invalidFeatureFmt}};r["default"]=m,"undefined"!=typeof window&&(window.Meyda=m),e.exports=r["default"]},{"./featureExtractors":26,"./meyda-wa":28,"./utilities":29,jsfft:6,"jsfft/lib/complex_array":5}],28:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0}),r.MeydaAnalyzer=void 0;var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=t("./utilities"),u=n(i),s=t("./featureExtractors"),c=n(s);r.MeydaAnalyzer=function(){function t(e,r){if(o(this,t),this._m=r,!e.audioContext)throw this._m._errors.noAC;if(e.bufferSize&&!u.isPowerOfTwo(e.bufferSize))throw this._m._errors.notPow2;if(!e.source)throw this._m._errors.noSource;this._m.audioContext=e.audioContext,this._m.bufferSize=e.bufferSize||r.bufferSize||256,this._m.sampleRate=e.sampleRate||this._m.audioContext.sampleRate||44100,this._m.callback=e.callback,this._m.windowingFunction=e.windowingFunction||"hanning",this._m.featureExtractors=c,this._m.EXTRACTION_STARTED=e.startImmediately||!1,this._m.spn=this._m.audioContext.createScriptProcessor(this._m.bufferSize,1,1),this._m.spn.connect(this._m.audioContext.destination),this._m._featuresToExtract=e.featureExtractors||[],this._m.barkScale=u.createBarkScale(this._m.bufferSize,this._m.sampleRate,this._m.bufferSize),this._m.melFilterBank=u.createMelFilterBank(this._m.melBands,this._m.sampleRate,this._m.bufferSize),this._m.inputData=null,r=this,this.setSource(e.source),this._m.spn.onaudioprocess=function(t){r._m.inputData=t.inputBuffer.getChannelData(0);var e=r._m.extract(r._m._featuresToExtract,r._m.inputData);"function"==typeof r._m.callback&&r._m.EXTRACTION_STARTED&&r._m.callback(e)}}return a(t,[{key:"start",value:function(t){this._m._featuresToExtract=t,this._m.EXTRACTION_STARTED=!0}},{key:"stop",value:function(){this._m.EXTRACTION_STARTED=!1}},{key:"setSource",value:function(t){t.connect(this._m.spn)}},{key:"get",value:function(t){return null!==this._m.inputData?this._m.extract(t||this._m._featuresToExtract,this._m.inputData):null}}]),t}()},{"./featureExtractors":26,"./utilities":29}],29:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){for(;t%2===0&&t>1;)t/=2;return 1===t}function a(t){throw new Error("Meyda: "+t)}function i(t,e){for(var r=[],n=0;n<Math.min(t.length,e.length);n++)r[n]=t[n]*e[n];return r}function u(t,e){if("rect"!==e&&(""!==e&&e||(e="hanning"),x[e]||(x[e]={}),!x[e][t.length]))try{x[e][t.length]=w[e](t.length),t=i(t,x[e][t.length])}catch(r){throw new Error("Invalid windowing function")}return t}function s(t,e,r){for(var n=new Float32Array(t),o=0;o<n.length;o++)n[o]=o*e/r,n[o]=13*Math.atan(n[o]/1315.8)+3.5*Math.atan(Math.pow(n[o]/7518,2));
return n}function c(t){return Array.prototype.slice.call(t)}function f(t){return Float32Array.from(t)}function l(t,e){return t/e}function p(t,e){return t.map(function(t){return t/e})}function m(t){var e=0;return t.forEach(function(t,r,n){t>e&&(e=t)}),t.map(function(t){return t/e})}function y(t){return t.reduce(function(t,e){return t+e})/t.length}function h(t){var e=700*(Math.exp(t/1125)-1);return e}function d(t){var e=1125*Math.log(1+t/700);return e}function g(t){return h(t)}function b(t){return d(t)}function S(t,e,r){for(var n=new Float32Array(t+2),o=new Float32Array(t+2),a=0,i=e/2,u=d(a),s=d(i),c=s-u,f=c/(t+1),l=Array(t+2),p=0;p<n.length;p++)n[p]=p*f,o[p]=h(n[p]),l[p]=Math.floor((r+1)*o[p]/e);for(var m=Array(t),y=0;y<m.length;y++){m[y]=Array.apply(null,new Array(r/2+1)).map(Number.prototype.valueOf,0);for(var p=l[y];p<l[y+1];p++)m[y][p]=(p-l[y])/(l[y+1]-l[y]);for(var p=l[y+1];p<l[y+2];p++)m[y][p]=(l[y+2]-p)/(l[y+2]-l[y+1])}return m}Object.defineProperty(r,"__esModule",{value:!0}),r.isPowerOfTwo=o,r.error=a,r.pointwiseBufferMult=i,r.applyWindow=u,r.createBarkScale=s,r.typedToArray=c,r.arrayToTyped=f,r.normalize=l,r.normalize_a=p,r.normalize_a_to_1=m,r.mean=y,r.melToFreq=g,r.freqToMel=b,r.createMelFilterBank=S;var v=t("./windowing"),w=n(v),x={}},{"./windowing":30}],30:[function(t,e,r){"use strict";function n(t){for(var e=new Float32Array(t),r=2*Math.PI/(t-1),n=2*r,o=0;t/2>o;o++)e[o]=.42-.5*Math.cos(o*r)+.08*Math.cos(o*n);for(var o=t/2;o>0;o--)e[t-o]=e[o-1];return e}function o(t){for(var e=Math.PI/(t-1),r=new Float32Array(t),n=0;t>n;n++)r[n]=Math.sin(e*n);return r}function a(t){for(var e=new Float32Array(t),r=0;t>r;r++)e[r]=.5-.5*Math.cos(2*Math.PI*r/(t-1));return e}function i(t){for(var e=new Float32Array(t),r=0;t>r;r++)e[r]=.54-.46*Math.cos(2*Math.PI*(r/t-1));return e}Object.defineProperty(r,"__esModule",{value:!0}),r.blackman=n,r.sine=o,r.hanning=a,r.hamming=i},{}]},{},[27]);
{
"name": "meyda",
"version": "3.0.2",
"version": "3.0.3",
"description": "Real-time feature extraction for the web audio api",

@@ -51,3 +51,3 @@ "main": "./dist/node/main.js",

"chai": "^3.1.0",
"codeclimate-test-reporter": "^0.2.1",
"codeclimate-test-reporter": "^0.3.1",
"gulp": "^3.9.0",

@@ -54,0 +54,0 @@ "gulp-babel": "^6.1.0",

@@ -5,3 +5,3 @@ import * as utilities from './utilities';

import * as complex_array from 'jsfft/lib/complex_array';
import * as MeydaAnalyzer from './meyda-wa';
import {MeydaAnalyzer} from './meyda-wa';

@@ -8,0 +8,0 @@

import * as utilities from './utilities';
import * as featureExtractors from './featureExtractors';
class MeydaAnalyzer{
export class MeydaAnalyzer{
constructor(options, self){
this._m = self;
if (!options.audioContext)
throw self._errors.noAC;
throw this._m._errors.noAC;
else if (options.bufferSize && !utilities.isPowerOfTwo(options.bufferSize))
throw self._errors.notPow2;
throw this._m._errors.notPow2;
else if (!options.source)
throw self._errors.noSource;
throw this._m._errors.noSource;
self.audioContext = options.audioContext;
this._m.audioContext = options.audioContext;
// TODO: validate options
self.setSource(options.source);
self.bufferSize = options.bufferSize || self.bufferSize || 256;
self.sampleRate = options.sampleRate || self.audioContext.sampleRate || 44100;
self.callback = options.callback;
self.windowingFunction = options.windowingFunction || "hanning";
self.featureExtractors = featureExtractors;
self.EXTRACTION_STARTED = options.startImmediately || false;
this._m.bufferSize = options.bufferSize || self.bufferSize || 256;
this._m.sampleRate = options.sampleRate || this._m.audioContext.sampleRate || 44100;
this._m.callback = options.callback;
this._m.windowingFunction = options.windowingFunction || "hanning";
this._m.featureExtractors = featureExtractors;
this._m.EXTRACTION_STARTED = options.startImmediately || false;
//create nodes
self.spn = self.audioContext.createScriptProcessor(self.bufferSize,1,1);
self.spn.connect(self.audioContext.destination);
this._m.spn = this._m.audioContext.createScriptProcessor(this._m.bufferSize,1,1);
this._m.spn.connect(this._m.audioContext.destination);
self._featuresToExtract = options.featureExtractors || [];
this._m._featuresToExtract = options.featureExtractors || [];
//always recalculate BS and MFB when a new Meyda analyzer is created.
self.barkScale = utilities.createBarkScale(self.bufferSize, self.sampleRate, self.bufferSize);
self.melFilterBank = utilities.createMelFilterBank(self.melBands, self.sampleRate, self.bufferSize);
this._m.barkScale = utilities.createBarkScale(this._m.bufferSize, this._m.sampleRate, this._m.bufferSize);
this._m.melFilterBank = utilities.createMelFilterBank(this._m.melBands, this._m.sampleRate, this._m.bufferSize);
self.inputData = null;
this._m.inputData = null;
self.spn.onaudioprocess = function(e) {
// self is to obtain the current frame pcm data
self.inputData = e.inputBuffer.getChannelData(0);
self = this;
var features = self.extract(self._featuresToExtract, self.inputData);
this.setSource(options.source);
this._m.spn.onaudioprocess = function(e){
self._m.inputData = e.inputBuffer.getChannelData(0);
var features = self._m.extract(self._m._featuresToExtract, self._m.inputData);
// call callback if applicable
if (typeof self.callback === "function" && self.EXTRACTION_STARTED) {
self.callback(features);
if (typeof self._m.callback === "function" && self._m.EXTRACTION_STARTED) {
self._m.callback(features);
}

@@ -51,17 +54,17 @@

start(features) {
self._featuresToExtract = features;
self.EXTRACTION_STARTED = true;
this._m._featuresToExtract = features;
this._m.EXTRACTION_STARTED = true;
}
stop() {
self.EXTRACTION_STARTED = false;
this._m.EXTRACTION_STARTED = false;
}
setSource(source) {
source.connect(this.spn);
source.connect(this._m.spn);
}
get(features){
if(self.inputData !== null){
return self.extract((features || self._featuresToExtract), self.inputData);
if(this._m.inputData !== null){
return this._m.extract((features || this._m._featuresToExtract), this._m.inputData);
} else {

@@ -72,3 +75,1 @@ return null;

}
export default MeydaAnalyzer;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc