Comparing version 2.0.2 to 2.0.3
{ | ||
"name": "meyda", | ||
"main": "dist/web/meyda.min.js", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"homepage": "https://github.com/hughrawlinson/meyda", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -48,6 +48,6 @@ 'use strict'; | ||
self.featureExtractors = _featureExtractors2['default']; | ||
self.EXTRACTION_STARTED = options.startImmediately || false; | ||
//callback controllers | ||
var EXTRACTION_STARTED = false; | ||
var _featuresToExtract; | ||
self._featuresToExtract = options.featureExtractors || []; | ||
@@ -82,4 +82,4 @@ self.barkScale = new Float32Array(self.bufferSize); | ||
// call callback if applicable | ||
if (typeof callback === "function" && EXTRACTION_STARTED) { | ||
callback(self.get(_featuresToExtract)); | ||
if (typeof self.callback === "function" && self.EXTRACTION_STARTED) { | ||
self.callback(self.get(self._featuresToExtract)); | ||
} | ||
@@ -92,4 +92,4 @@ }; | ||
value: function start(features) { | ||
_featuresToExtract = features; | ||
EXTRACTION_STARTED = true; | ||
self._featuresToExtract = features; | ||
self.EXTRACTION_STARTED = true; | ||
} | ||
@@ -99,3 +99,3 @@ }, { | ||
value: function stop() { | ||
EXTRACTION_STARTED = false; | ||
self.EXTRACTION_STARTED = false; | ||
} | ||
@@ -144,3 +144,3 @@ }, { | ||
if (typeof window !== 'undefined') window.Meyda = Meyda; | ||
if (typeof window !== "undefined") window.Meyda = Meyda; | ||
module.exports = exports['default']; |
@@ -1,1 +0,1 @@ | ||
!function e(t,r,n){function o(u,i){if(!r[u]){if(!t[u]){var c="function"==typeof require&&require;if(!i&&c)return c(u,!0);if(a)return a(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var l=r[u]={exports:{}};t[u][0].call(l.exports,function(e){var r=t[u][1][e];return o(r?r:e)},l,l.exports,e,t,r,n)}return r[u].exports}for(var a="function"==typeof require&&require,u=0;u<n.length;u++)o(n[u]);return o}({1:[function(e,t,r){function n(e,t){return g.isUndefined(t)?""+t:g.isNumber(t)&&!isFinite(t)?t.toString():g.isFunction(t)||g.isRegExp(t)?t.toString():t}function o(e,t){return g.isString(e)?e.length<t?e:e.slice(0,t):e}function a(e){return o(JSON.stringify(e.actual,n),128)+" "+e.operator+" "+o(JSON.stringify(e.expected,n),128)}function u(e,t,r,n,o){throw new d.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:o})}function i(e,t){e||u(e,!0,t,"==",d.ok)}function c(e,t){if(e===t)return!0;if(g.isBuffer(e)&&g.isBuffer(t)){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return g.isDate(e)&&g.isDate(t)?e.getTime()===t.getTime():g.isRegExp(e)&&g.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:g.isObject(e)||g.isObject(t)?l(e,t):e==t}function s(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function l(e,t){if(g.isNullOrUndefined(e)||g.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(g.isPrimitive(e)||g.isPrimitive(t))return e===t;var r=s(e),n=s(t);if(r&&!n||!r&&n)return!1;if(r)return e=m.call(e),t=m.call(t),c(e,t);var o,a,u=y(e),i=y(t);if(u.length!=i.length)return!1;for(u.sort(),i.sort(),a=u.length-1;a>=0;a--)if(u[a]!=i[a])return!1;for(a=u.length-1;a>=0;a--)if(o=u[a],!c(e[o],t[o]))return!1;return!0}function f(e,t){return e&&t?"[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1:!1}function p(e,t,r,n){var o;g.isString(r)&&(n=r,r=null);try{t()}catch(a){o=a}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!o&&u(o,r,"Missing expected exception"+n),!e&&f(o,r)&&u(o,r,"Got unwanted exception"+n),e&&o&&r&&!f(o,r)||!e&&o)throw o}var g=e("util/"),m=Array.prototype.slice,h=Object.prototype.hasOwnProperty,d=t.exports=i;d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=a(this),this.generatedMessage=!0);var t=e.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,o=t.name,i=n.indexOf("\n"+o);if(i>=0){var c=n.indexOf("\n",i+1);n=n.substring(c+1)}this.stack=n}}},g.inherits(d.AssertionError,Error),d.fail=u,d.ok=i,d.equal=function(e,t,r){e!=t&&u(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&u(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){c(e,t)||u(e,t,r,"deepEqual",d.deepEqual)},d.notDeepEqual=function(e,t,r){c(e,t)&&u(e,t,r,"notDeepEqual",d.notDeepEqual)},d.strictEqual=function(e,t,r){e!==t&&u(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&u(e,t,r,"!==",d.notStrictEqual)},d["throws"]=function(e,t,r){p.apply(this,[!0].concat(m.call(arguments)))},d.doesNotThrow=function(e,t){p.apply(this,[!1].concat(m.call(arguments)))},d.ifError=function(e){if(e)throw e};var y=Object.keys||function(e){var t=[];for(var r in e)h.call(e,r)&&t.push(r);return t}},{"util/":5}],2:[function(e,t,r){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],3:[function(e,t,r){function n(){l=!1,i.length?s=i.concat(s):f=-1,s.length&&o()}function o(){if(!l){var e=setTimeout(n);l=!0;for(var t=s.length;t;){for(i=s,s=[];++f<t;)i[f].run();f=-1,t=s.length}i=null,l=!1,clearTimeout(e)}}function a(e,t){this.fun=e,this.array=t}function u(){}var i,c=t.exports={},s=[],l=!1,f=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new a(e,t)),1!==s.length||l||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=u,c.addListener=u,c.once=u,c.off=u,c.removeListener=u,c.removeAllListeners=u,c.emit=u,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},{}],4:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],5:[function(e,t,r){(function(t,n){function o(e,t){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(t)?n.showHidden=t:t&&r._extend(n,t),S(n.showHidden)&&(n.showHidden=!1),S(n.depth)&&(n.depth=2),S(n.colors)&&(n.colors=!1),S(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),c(n,e,n.depth)}function a(e,t){var r=o.styles[t];return r?"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m":e}function u(e,t){return e}function i(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function c(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(n,e);return w(o)||(o=c(e,o,n)),o}var a=s(e,t);if(a)return a;var u=Object.keys(t),h=i(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(t)),_(t)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return l(t);if(0===u.length){if(O(t)){var d=t.name?": "+t.name:"";return e.stylize("[Function"+d+"]","special")}if(x(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(j(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var y="",v=!1,b=["{","}"];if(m(t)&&(v=!0,b=["[","]"]),O(t)){var S=t.name?": "+t.name:"";y=" [Function"+S+"]"}if(x(t)&&(y=" "+RegExp.prototype.toString.call(t)),j(t)&&(y=" "+Date.prototype.toUTCString.call(t)),_(t)&&(y=" "+l(t)),0===u.length&&(!v||0==t.length))return b[0]+y+b[1];if(0>n)return x(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var M;return M=v?f(e,t,n,h,u):u.map(function(r){return p(e,t,n,h,r,v)}),e.seen.pop(),g(M,y,b)}function s(e,t){if(S(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return v(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):d(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,o){for(var a=[],u=0,i=t.length;i>u;++u)a.push(P(t,String(u))?p(e,t,r,n,String(u),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||a.push(p(e,t,r,n,o,!0))}),a}function p(e,t,r,n,o,a){var u,i,s;if(s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},s.get?i=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(i=e.stylize("[Setter]","special")),P(n,o)||(u="["+o+"]"),i||(e.seen.indexOf(s.value)<0?(i=d(r)?c(e,s.value,null):c(e,s.value,r-1),i.indexOf("\n")>-1&&(i=a?i.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+i.split("\n").map(function(e){return" "+e}).join("\n"))):i=e.stylize("[Circular]","special")),S(u)){if(a&&o.match(/^\d+$/))return i;u=JSON.stringify(""+o),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+i}function g(e,t,r){var n=0,o=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function m(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function d(e){return null===e}function y(e){return null==e}function v(e){return"number"==typeof e}function w(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function S(e){return void 0===e}function x(e){return M(e)&&"[object RegExp]"===T(e)}function M(e){return"object"==typeof e&&null!==e}function j(e){return M(e)&&"[object Date]"===T(e)}function _(e){return M(e)&&("[object Error]"===T(e)||e instanceof Error)}function O(e){return"function"==typeof e}function E(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function T(e){return Object.prototype.toString.call(e)}function A(e){return 10>e?"0"+e.toString(10):e.toString(10)}function F(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var k=/%[sdj%]/g;r.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,a=n.length,u=String(e).replace(k,function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}}),i=n[r];a>r;i=n[++r])u+=d(i)||!M(i)?" "+i:" "+o(i);return u},r.deprecate=function(e,o){function a(){if(!u){if(t.throwDeprecation)throw new Error(o);t.traceDeprecation?console.trace(o):console.error(o),u=!0}return e.apply(this,arguments)}if(S(n.process))return function(){return r.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var u=!1;return a};var z,q={};r.debuglog=function(e){if(S(z)&&(z=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!q[e])if(new RegExp("\\b"+e+"\\b","i").test(z)){var n=t.pid;q[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else q[e]=function(){};return q[e]},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=y,r.isNumber=v,r.isString=w,r.isSymbol=b,r.isUndefined=S,r.isRegExp=x,r.isObject=M,r.isDate=j,r.isError=_,r.isFunction=O,r.isPrimitive=E,r.isBuffer=e("./support/isBuffer");var R=["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=e("inherits"),r._extend=function(e,t){if(!t||!M(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":4,_process:3,inherits:2}],6:[function(e,t,r){"use strict";!function(e,t){function r(e){return e.forEach||(e.forEach=function(e){var t,r=this.length;for(t=0;r>t;t++)e(this[t],t,r)}),e}var n,o,a=Float32Array,u=Math.sqrt,i=function(e){return Math.pow(e,2)};e.isComplexArray=n=function(e){return e!==t&&e.hasOwnProperty!==t&&e.hasOwnProperty("real")&&e.hasOwnProperty("imag")},e.ComplexArray=o=function(e,t){n(e)?(this.ArrayType=e.ArrayType,this.real=new this.ArrayType(e.real),this.imag=new this.ArrayType(e.imag)):(this.ArrayType=t||a,this.real=new this.ArrayType(e),this.imag=new this.ArrayType(this.real.length)),this.length=this.real.length},o.prototype.toString=function(){var e=[];return this.forEach(function(t,r){e.push("("+t.real.toFixed(2)+","+t.imag.toFixed(2)+")")}),"["+e.join(",")+"]"},o.prototype.map=function(e){var t,r=this.length,n={};for(t=0;r>t;t++)n.real=this.real[t],n.imag=this.imag[t],e(n,t,r),this.real[t]=n.real,this.imag[t]=n.imag;return this},o.prototype.forEach=function(e){var t,r=this.length,n={};for(t=0;r>t;t++)n.real=this.real[t],n.imag=this.imag[t],e(n,t,r)},o.prototype.conjugate=function(){return new o(this).map(function(e){e.imag*=-1})},o.prototype.magnitude=function(){var e=new this.ArrayType(this.length);return this.forEach(function(t,r){e[r]=u(i(t.real)+i(t.imag))}),r(e)}}("undefined"==typeof r&&(this.complex_array={})||r)},{}],7:[function(e,t,r){"use strict";!function(e,t){function r(e){return t.isComplexArray(e)&&e||new s(e)}function n(e,t){var r=e.length;return r&r-1?o(e,t):a(e,t)}function o(e,t){var r,o,a,u,i,f,h,d,y,v,w,b,S,x,M=e.length;if(1===M)return e;for(a=new s(M,e.ArrayType),d=c(M),y=M/d,v=1/p(d),w=new s(y,e.ArrayType),o=0;d>o;o++){for(r=0;y>r;r++)w.real[r]=e.real[r*d+o],w.imag[r]=e.imag[r*d+o];for(y>1&&(w=n(w,t)),f=g(2*l*o/M),h=(t?-1:1)*m(2*l*o/M),u=1,i=0,r=0;M>r;r++)S=w.real[r%y],x=w.imag[r%y],a.real[r]+=u*S-i*x,a.imag[r]+=u*x+i*S,b=u*f-i*h,i=u*h+i*f,u=b}for(r=0;M>r;r++)e.real[r]=v*a.real[r],e.imag[r]=v*a.imag[r];return e}function a(e,t){var r,n,o,a,u,c,s,p,h,d,y,v,w,b,S,x,M,j=e.length;for(o=i(e),a=o.real,u=o.imag,M=1;j>M;){for(p=g(l/M),h=(t?-1:1)*m(l/M),r=0;j/(2*M)>r;r++)for(c=1,s=0,n=0;M>n;n++)y=2*r*M+n,v=y+M,w=a[y],b=u[y],S=c*a[v]-s*u[v],x=s*a[v]+c*u[v],a[y]=f*(w+S),u[y]=f*(b+x),a[v]=f*(w-S),u[v]=f*(b-x),d=c*p-s*h,s=c*h+s*p,c=d;M<<=1}return o}function u(e,t){for(var r=0;t>1;)r<<=1,r+=1&e,e>>=1,t>>=1;return r}function i(e){var t,r,n=e.length,o={};for(r=0;n>r;r++){var a=u(r,n);o.hasOwnProperty(r)||o.hasOwnProperty(a)||(t=e.real[a],e.real[a]=e.real[r],e.real[r]=t,t=e.imag[a],e.imag[a]=e.imag[r],e.imag[r]=t,o[r]=o[a]=!0)}return e}function c(e){for(var t=3,r=p(e);r>=t;){if(e%t===0)return t;t+=2}return e}var s=t.ComplexArray,l=Math.PI,f=Math.SQRT1_2,p=Math.sqrt,g=Math.cos,m=Math.sin;s.prototype.FFT=function(){return n(this,!1)},e.FFT=function(e){return r(e).FFT()},s.prototype.InvFFT=function(){return n(this,!0)},e.InvFFT=function(e){return r(e).InvFFT()},s.prototype.frequencyMap=function(e){return this.FFT().map(e).InvFFT()},e.frequencyMap=function(e,t){return r(e).frequencyMap(t)}}("undefined"==typeof r&&(this.fft={})||r,"undefined"==typeof e&&this.complex_array||e("./complex_array"))},{"./complex_array":6}],8:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}Object.defineProperty(r,"__esModule",{value:!0});{var o=e("assert");n(o)}r["default"]=function(){if("object"!=typeof arguments[0].signal)throw new TypeError;for(var e=0,t=0;t<arguments[0].signal.length;t++)e+=Math.pow(Math.abs(arguments[0].signal[t]),2);return e},t.exports=r["default"]},{assert:1}],9:[function(e,t,r){"use strict";function n(e,t){for(var r=0,n=0,o=0;o<t.length;o++)r+=Math.pow(o,e)*Math.abs(t[o]),n+=t[o];return r/n}Object.defineProperty(r,"__esModule",{value:!0}),r.mu=n},{}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;var t=24,r=new Float32Array(t),n=0,o=e.ampSpectrum,a=new Int32Array(t+1);a[0]=0;for(var u=e.barkScale[o.length-1]/t,i=1,c=0;c<o.length;c++)for(;e.barkScale[c]>u;)a[i++]=c,u=i*e.barkScale[o.length-1]/t;a[t]=o.length-1;for(var c=0;t>c;c++){for(var s=0,l=a[c];l<a[c+1];l++)s+=o[l];r[c]=Math.pow(s,.23)}for(var c=0;c<r.length;c++)n+=r[c];return{specific:r,total:n}},t.exports=r["default"]},{}],11:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./powerSpectrum"),a=n(o),u=function(e){var t=700*(Math.exp(e/1125)-1);return t},i=function(e){var t=1125*Math.log(1+e/700);return t};r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;for(var t=a["default"](e),r=26,n=new Float32Array(r+2),o=new Float32Array(r+2),c=0,s=e.sampleRate/2,l=i(c),f=i(s),p=f-l,g=p/(r+1),m=Array(r+2),h=0;h<n.length;h++)n[h]=h*g,o[h]=u(n[h]),m[h]=Math.floor((e.bufferSize+1)*o[h]/e.sampleRate);for(var d=Array(r),y=0;y<d.length;y++){d[y]=Array.apply(null,new Array(e.bufferSize/2+1)).map(Number.prototype.valueOf,0);for(var h=m[y];h<m[y+1];h++)d[y][h]=(h-m[y])/(m[y+1]-m[y]);for(var h=m[y+1];h<m[y+2];h++)d[y][h]=(m[y+2]-h)/(m[y+2]-m[y+1])}for(var v=new Float32Array(r),h=0;h<v.length;h++){v[h]=0;for(var y=0;y<e.bufferSize/2;y++)d[h][y]=d[h][y]*t[y],v[h]+=d[h][y];v[h]=Math.log(v[h])}for(var w=Math.PI/r,b=1/Math.sqrt(r),S=Math.sqrt(2/r),x=13,M=new Float32Array(x*r),h=0;x>h;h++)for(var y=0;r>y;y++){var j=h+y*x;M[j]=0===h?b*Math.cos(w*(h+1)*(y+.5)):S*Math.cos(w*(h+1)*(y+.5))}for(var _=new Float32Array(x),O=0;x>O;O++){for(var E=0,T=0;r>T;T++){var j=O+T*x;E+=M[j]*v[T]}_[O]=E/x}return _},t.exports=r["default"]},{"./powerSpectrum":14}],12:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./loudness"),a=n(o);r["default"]=function(){if("object"!=typeof arguments[0].signal)throw new TypeError;for(var e=a["default"](arguments[0]),t=e.specific,r=0,n=0;n<t.length;n++)r+=15>n?(n+1)*t[n+1]:.066*Math.exp(.171*(n+1));return r*=.11/e.total},t.exports=r["default"]},{"./loudness":10}],13:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./loudness"),a=n(o);r["default"]=function(){if("object"!=typeof arguments[0].signal)throw new TypeError;for(var e=a["default"](arguments[0]),t=0,r=0;r<e.specific.length;r++)e.specific[r]>t&&(t=e.specific[r]);var n=Math.pow((e.total-t)/e.total,2);return n},t.exports=r["default"]},{"./loudness":10}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;for(var e=new Float32Array(arguments[0].ampSpectrum.length),t=0;t<e.length;t++)e[t]=Math.pow(arguments[0].ampSpectrum[t],2);return e},t.exports=r["default"]},{}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(e){if("object"!=typeof e.signal)throw new TypeError;for(var t=0,r=0;r<e.signal.length;r++)t+=Math.pow(e.signal[r],2);return t/=e.signal.length,t=Math.sqrt(t)},t.exports=r["default"]},{}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./extractorUtilities");r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;return n.mu(1,arguments[0].ampSpectrum)},t.exports=r["default"]},{"./extractorUtilities":9}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;for(var e=0,t=0,r=0;r<arguments[0].ampSpectrum.length;r++)e+=Math.log(arguments[0].ampSpectrum[r]),t+=arguments[0].ampSpectrum[r];return Math.exp(e/arguments[0].ampSpectrum.length)*arguments[0].ampSpectrum.length/t},t.exports=r["default"]},{}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./extractorUtilities");r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;var e=arguments[0].ampSpectrum,t=n.mu(1,e),r=n.mu(2,e),o=n.mu(3,e),a=n.mu(4,e),u=-3*Math.pow(t,4)+6*t*r-4*t*o+a,i=Math.pow(Math.sqrt(r-Math.pow(t,2)),4);return u/i},t.exports=r["default"]},{"./extractorUtilities":9}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;for(var e=arguments[0].ampSpectrum,t=arguments[0].sampleRate/(2*(e.length-1)),r=0,n=0;n<e.length;n++)r+=e[n];for(var o=.99*r,a=e.length-1;r>o&&a>=0;)r-=e[a],--a;return(a+1)*t},t.exports=r["default"]},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./extractorUtilities");r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;var t=n.mu(1,e.ampSpectrum),r=n.mu(2,e.ampSpectrum),o=n.mu(3,e.ampSpectrum),a=2*Math.pow(t,3)-3*t*r+o,u=Math.pow(Math.sqrt(r-Math.pow(t,2)),3);return a/u},t.exports=r["default"]},{"./extractorUtilities":9}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;for(var t=0,r=0,n=new Float32Array(e.ampSpectrum.length),o=0,a=0,u=0;u<e.ampSpectrum.length;u++){t+=e.ampSpectrum[u];var i=u*e.sampleRate/e.bufferSize;n[u]=i,o+=i*i,r+=i,a+=i*e.ampSpectrum[u]}return(e.ampSpectrum.length*a-r*t)/(t*(o-Math.pow(r,2)))},t.exports=r["default"]},{}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./extractorUtilities");r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;return Math.sqrt(n.mu(2,e.ampSpectrum)-Math.pow(n.mu(1,e.ampSpectrum),2))},t.exports=r["default"]},{"./extractorUtilities":9}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!=typeof arguments[0].signal)throw new TypeError;for(var e=0,t=0;t<arguments[0].signal.length;t++)(arguments[0].signal[t]>=0&&arguments[0].signal[t+1]<0||arguments[0].signal[t]<0&&arguments[0].signal[t+1]>=0)&&e++;return e},t.exports=r["default"]},{}],24:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./extractors/rms"),a=n(o),u=e("./extractors/energy"),i=n(u),c=e("./extractors/spectralSlope"),s=n(c),l=e("./extractors/spectralCentroid"),f=n(l),p=e("./extractors/spectralRolloff"),g=n(p),m=e("./extractors/spectralFlatness"),h=n(m),d=e("./extractors/spectralSpread"),y=n(d),v=e("./extractors/spectralSkewness"),w=n(v),b=e("./extractors/spectralKurtosis"),S=n(b),x=e("./extractors/zcr"),M=n(x),j=e("./extractors/loudness"),_=n(j),O=e("./extractors/perceptualSpread"),E=n(O),T=e("./extractors/perceptualSharpness"),A=n(T),F=e("./extractors/mfcc"),P=n(F),k=e("./extractors/powerSpectrum"),z=n(k);r["default"]={buffer:function(e){return e.signal},rms:a["default"],energy:i["default"],complexSpectrum:function(e){return e.complexSpectrum},spectralSlope:s["default"],spectralCentroid:f["default"],spectralRolloff:g["default"],spectralFlatness:h["default"],spectralSpread:y["default"],spectralSkewness:w["default"],spectralKurtosis:S["default"],amplitudeSpectrum:function(e){return e.ampSpectrum},zcr:M["default"],loudness:_["default"],perceptualSpread:E["default"],perceptualSharpness:A["default"],powerSpectrum:z["default"],mfcc:P["default"]},t.exports=r["default"]},{"./extractors/energy":8,"./extractors/loudness":10,"./extractors/mfcc":11,"./extractors/perceptualSharpness":12,"./extractors/perceptualSpread":13,"./extractors/powerSpectrum":14,"./extractors/rms":15,"./extractors/spectralCentroid":16,"./extractors/spectralFlatness":17,"./extractors/spectralKurtosis":18,"./extractors/spectralRolloff":19,"./extractors/spectralSkewness":20,"./extractors/spectralSlope":21,"./extractors/spectralSpread":22,"./extractors/zcr":23}],25:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./utilities"),c=o(i),s=e("./featureExtractors"),l=n(s),f=e("jsfft"),p=(o(f),e("jsfft/lib/complex_array")),g=o(p),m=function(){function e(t){a(this,e);var r=this;r.audioContext=t.audioContext,r.spn=r.audioContext.createScriptProcessor(r.bufferSize,1,1),r.spn.connect(r.audioContext.destination),r.setSource(t.source),r.bufferSize=t.bufferSize||256,r.callback=t.callback,r.windowingFunction=t.windowingFunction||"hanning",r.featureExtractors=l["default"];var n,o=!1;r.barkScale=new Float32Array(r.bufferSize);for(var u=0;u<r.barkScale.length;u++)r.barkScale[u]=u*r.audioContext.sampleRate/r.bufferSize,r.barkScale[u]=13*Math.atan(r.barkScale[u]/1315.8)+3.5*Math.atan(Math.pow(r.barkScale[u]/7518,2));r.spn.onaudioprocess=function(e){var t=e.inputBuffer.getChannelData(0);r.signal=t;var a=c.applyWindow(t,r.windowingFunction),u=new g.ComplexArray(r.bufferSize);u.map(function(e,t,r){e.real=a[t]});var i=u.FFT();r.complexSpectrum=i,r.ampSpectrum=new Float32Array(r.bufferSize/2);for(var s=0;s<r.bufferSize/2;s++)r.ampSpectrum[s]=Math.sqrt(Math.pow(i.real[s],2)+Math.pow(i.imag[s],2));"function"==typeof callback&&o&&callback(r.get(n))}}return u(e,[{key:"start",value:function(e){_featuresToExtract=e,EXTRACTION_STARTED=!0}},{key:"stop",value:function(){EXTRACTION_STARTED=!1}},{key:"setSource",value:function(e){e.connect(this.spn)}},{key:"get",value:function(e){var t=this;if("object"==typeof e){for(var r={},n=0;n<e.length;n++)r[e[n]]=l["default"][e[n]]({ampSpectrum:t.ampSpectrum,complexSpectrum:t.complexSpectrum,signal:t.signal,bufferSize:t.bufferSize,sampleRate:t.audioContext.sampleRate,barkScale:t.barkScale});return r}if("string"==typeof e)return l["default"][e]({ampSpectrum:t.ampSpectrum,complexSpectrum:t.complexSpectrum,signal:t.signal,bufferSize:t.bufferSize,sampleRate:t.audioContext.sampleRate,barkScale:t.barkScale});throw"Invalid Feature Format"}}]),e}();r["default"]=m,"undefined"!=typeof window&&(window.Meyda=m),t.exports=r["default"]},{"./featureExtractors":24,"./utilities":26,jsfft:7,"jsfft/lib/complex_array":6}],26:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){for(;e%2===0&&e>1;)e/=2;return 1===e}function a(e){throw new Error("Meyda: "+e)}function u(e,t){for(var r=[],n=0;n<Math.min(e.length,t.length);n++)r[n]=e[n]*t[n];return r}function i(e,t){return l[t]||(l[t]={}),l[t][e.length]||(l[t][e.length]=s.hanning(e.length)),u(e,l[t][e.length])}Object.defineProperty(r,"__esModule",{value:!0}),r.isPowerOfTwo=o,r.error=a,r.pointwiseBufferMult=u,r.applyWindow=i;var c=e("./windowing"),s=n(c),l={}},{"./windowing":27}],27:[function(e,t,r){"use strict";function n(e){for(var t=new Float32Array(e),r=0;e>r;r++)t[r]=.5-.5*Math.cos(2*Math.PI*r/(e-1));return t}function o(e){for(var t=new Float32Array(e),r=0;e>r;r++)t[r]=.54-.46*Math.cos(2*Math.PI*(r/e-1));return t}Object.defineProperty(r,"__esModule",{value:!0}),r.hanning=n,r.hamming=o},{}]},{},[25]); | ||
!function e(t,r,n){function o(u,i){if(!r[u]){if(!t[u]){var s="function"==typeof require&&require;if(!i&&s)return s(u,!0);if(a)return a(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[u]={exports:{}};t[u][0].call(l.exports,function(e){var r=t[u][1][e];return o(r?r:e)},l,l.exports,e,t,r,n)}return r[u].exports}for(var a="function"==typeof require&&require,u=0;u<n.length;u++)o(n[u]);return o}({1:[function(e,t,r){function n(e,t){return g.isUndefined(t)?""+t:g.isNumber(t)&&!isFinite(t)?t.toString():g.isFunction(t)||g.isRegExp(t)?t.toString():t}function o(e,t){return g.isString(e)?e.length<t?e:e.slice(0,t):e}function a(e){return o(JSON.stringify(e.actual,n),128)+" "+e.operator+" "+o(JSON.stringify(e.expected,n),128)}function u(e,t,r,n,o){throw new d.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:o})}function i(e,t){e||u(e,!0,t,"==",d.ok)}function s(e,t){if(e===t)return!0;if(g.isBuffer(e)&&g.isBuffer(t)){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return g.isDate(e)&&g.isDate(t)?e.getTime()===t.getTime():g.isRegExp(e)&&g.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:g.isObject(e)||g.isObject(t)?l(e,t):e==t}function c(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function l(e,t){if(g.isNullOrUndefined(e)||g.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(g.isPrimitive(e)||g.isPrimitive(t))return e===t;var r=c(e),n=c(t);if(r&&!n||!r&&n)return!1;if(r)return e=m.call(e),t=m.call(t),s(e,t);var o,a,u=y(e),i=y(t);if(u.length!=i.length)return!1;for(u.sort(),i.sort(),a=u.length-1;a>=0;a--)if(u[a]!=i[a])return!1;for(a=u.length-1;a>=0;a--)if(o=u[a],!s(e[o],t[o]))return!1;return!0}function f(e,t){return e&&t?"[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1:!1}function p(e,t,r,n){var o;g.isString(r)&&(n=r,r=null);try{t()}catch(a){o=a}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!o&&u(o,r,"Missing expected exception"+n),!e&&f(o,r)&&u(o,r,"Got unwanted exception"+n),e&&o&&r&&!f(o,r)||!e&&o)throw o}var g=e("util/"),m=Array.prototype.slice,h=Object.prototype.hasOwnProperty,d=t.exports=i;d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=a(this),this.generatedMessage=!0);var t=e.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,o=t.name,i=n.indexOf("\n"+o);if(i>=0){var s=n.indexOf("\n",i+1);n=n.substring(s+1)}this.stack=n}}},g.inherits(d.AssertionError,Error),d.fail=u,d.ok=i,d.equal=function(e,t,r){e!=t&&u(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&u(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){s(e,t)||u(e,t,r,"deepEqual",d.deepEqual)},d.notDeepEqual=function(e,t,r){s(e,t)&&u(e,t,r,"notDeepEqual",d.notDeepEqual)},d.strictEqual=function(e,t,r){e!==t&&u(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&u(e,t,r,"!==",d.notStrictEqual)},d["throws"]=function(e,t,r){p.apply(this,[!0].concat(m.call(arguments)))},d.doesNotThrow=function(e,t){p.apply(this,[!1].concat(m.call(arguments)))},d.ifError=function(e){if(e)throw e};var y=Object.keys||function(e){var t=[];for(var r in e)h.call(e,r)&&t.push(r);return t}},{"util/":5}],2:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],3:[function(e,t,r){function n(){l=!1,i.length?c=i.concat(c):f=-1,c.length&&o()}function o(){if(!l){var e=setTimeout(n);l=!0;for(var t=c.length;t;){for(i=c,c=[];++f<t;)i[f].run();f=-1,t=c.length}i=null,l=!1,clearTimeout(e)}}function a(e,t){this.fun=e,this.array=t}function u(){}var i,s=t.exports={},c=[],l=!1,f=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new a(e,t)),1!==c.length||l||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=u,s.addListener=u,s.once=u,s.off=u,s.removeListener=u,s.removeAllListeners=u,s.emit=u,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],4:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],5:[function(e,t,r){(function(t,n){function o(e,t){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(t)?n.showHidden=t:t&&r._extend(n,t),S(n.showHidden)&&(n.showHidden=!1),S(n.depth)&&(n.depth=2),S(n.colors)&&(n.colors=!1),S(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,e,n.depth)}function a(e,t){var r=o.styles[t];return r?"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m":e}function u(e,t){return e}function i(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function s(e,t,n){if(e.customInspect&&t&&j(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(n,e);return w(o)||(o=s(e,o,n)),o}var a=c(e,t);if(a)return a;var u=Object.keys(t),h=i(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(t)),_(t)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return l(t);if(0===u.length){if(j(t)){var d=t.name?": "+t.name:"";return e.stylize("[Function"+d+"]","special")}if(x(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(E(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return l(t)}var y="",v=!1,b=["{","}"];if(m(t)&&(v=!0,b=["[","]"]),j(t)){var S=t.name?": "+t.name:"";y=" [Function"+S+"]"}if(x(t)&&(y=" "+RegExp.prototype.toString.call(t)),E(t)&&(y=" "+Date.prototype.toUTCString.call(t)),_(t)&&(y=" "+l(t)),0===u.length&&(!v||0==t.length))return b[0]+y+b[1];if(0>n)return x(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var M;return M=v?f(e,t,n,h,u):u.map(function(r){return p(e,t,n,h,r,v)}),e.seen.pop(),g(M,y,b)}function c(e,t){if(S(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return v(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):d(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,o){for(var a=[],u=0,i=t.length;i>u;++u)P(t,String(u))?a.push(p(e,t,r,n,String(u),!0)):a.push("");return o.forEach(function(o){o.match(/^\d+$/)||a.push(p(e,t,r,n,o,!0))}),a}function p(e,t,r,n,o,a){var u,i,c;if(c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},c.get?i=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(i=e.stylize("[Setter]","special")),P(n,o)||(u="["+o+"]"),i||(e.seen.indexOf(c.value)<0?(i=d(r)?s(e,c.value,null):s(e,c.value,r-1),i.indexOf("\n")>-1&&(i=a?i.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+i.split("\n").map(function(e){return" "+e}).join("\n"))):i=e.stylize("[Circular]","special")),S(u)){if(a&&o.match(/^\d+$/))return i;u=JSON.stringify(""+o),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+i}function g(e,t,r){var n=0,o=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function m(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function d(e){return null===e}function y(e){return null==e}function v(e){return"number"==typeof e}function w(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function S(e){return void 0===e}function x(e){return M(e)&&"[object RegExp]"===T(e)}function M(e){return"object"==typeof e&&null!==e}function E(e){return M(e)&&"[object Date]"===T(e)}function _(e){return M(e)&&("[object Error]"===T(e)||e instanceof Error)}function j(e){return"function"==typeof e}function O(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function T(e){return Object.prototype.toString.call(e)}function A(e){return 10>e?"0"+e.toString(10):e.toString(10)}function F(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),q[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var k=/%[sdj%]/g;r.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,a=n.length,u=String(e).replace(k,function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}}),i=n[r];a>r;i=n[++r])u+=d(i)||!M(i)?" "+i:" "+o(i);return u},r.deprecate=function(e,o){function a(){if(!u){if(t.throwDeprecation)throw new Error(o);t.traceDeprecation?console.trace(o):console.error(o),u=!0}return e.apply(this,arguments)}if(S(n.process))return function(){return r.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var u=!1;return a};var z,R={};r.debuglog=function(e){if(S(z)&&(z=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(new RegExp("\\b"+e+"\\b","i").test(z)){var n=t.pid;R[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else R[e]=function(){};return R[e]},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=y,r.isNumber=v,r.isString=w,r.isSymbol=b,r.isUndefined=S,r.isRegExp=x,r.isObject=M,r.isDate=E,r.isError=_,r.isFunction=j,r.isPrimitive=O,r.isBuffer=e("./support/isBuffer");var q=["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=e("inherits"),r._extend=function(e,t){if(!t||!M(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":4,_process:3,inherits:2}],6:[function(e,t,r){"use strict";!function(e,t){function r(e){return e.forEach||(e.forEach=function(e){var t,r=this.length;for(t=0;r>t;t++)e(this[t],t,r)}),e}var n,o,a=Float32Array,u=Math.sqrt,i=function(e){return Math.pow(e,2)};e.isComplexArray=n=function(e){return e!==t&&e.hasOwnProperty!==t&&e.hasOwnProperty("real")&&e.hasOwnProperty("imag")},e.ComplexArray=o=function(e,t){n(e)?(this.ArrayType=e.ArrayType,this.real=new this.ArrayType(e.real),this.imag=new this.ArrayType(e.imag)):(this.ArrayType=t||a,this.real=new this.ArrayType(e),this.imag=new this.ArrayType(this.real.length)),this.length=this.real.length},o.prototype.toString=function(){var e=[];return this.forEach(function(t,r){e.push("("+t.real.toFixed(2)+","+t.imag.toFixed(2)+")")}),"["+e.join(",")+"]"},o.prototype.map=function(e){var t,r=this.length,n={};for(t=0;r>t;t++)n.real=this.real[t],n.imag=this.imag[t],e(n,t,r),this.real[t]=n.real,this.imag[t]=n.imag;return this},o.prototype.forEach=function(e){var t,r=this.length,n={};for(t=0;r>t;t++)n.real=this.real[t],n.imag=this.imag[t],e(n,t,r)},o.prototype.conjugate=function(){return new o(this).map(function(e){e.imag*=-1})},o.prototype.magnitude=function(){var e=new this.ArrayType(this.length);return this.forEach(function(t,r){e[r]=u(i(t.real)+i(t.imag))}),r(e)}}("undefined"==typeof r&&(this.complex_array={})||r)},{}],7:[function(e,t,r){"use strict";!function(e,t){function r(e){return t.isComplexArray(e)&&e||new c(e)}function n(e,t){var r=e.length;return r&r-1?o(e,t):a(e,t)}function o(e,t){var r,o,a,u,i,f,h,d,y,v,w,b,S,x,M=e.length;if(1===M)return e;for(a=new c(M,e.ArrayType),d=s(M),y=M/d,v=1/p(d),w=new c(y,e.ArrayType),o=0;d>o;o++){for(r=0;y>r;r++)w.real[r]=e.real[r*d+o],w.imag[r]=e.imag[r*d+o];for(y>1&&(w=n(w,t)),f=g(2*l*o/M),h=(t?-1:1)*m(2*l*o/M),u=1,i=0,r=0;M>r;r++)S=w.real[r%y],x=w.imag[r%y],a.real[r]+=u*S-i*x,a.imag[r]+=u*x+i*S,b=u*f-i*h,i=u*h+i*f,u=b}for(r=0;M>r;r++)e.real[r]=v*a.real[r],e.imag[r]=v*a.imag[r];return e}function a(e,t){var r,n,o,a,u,s,c,p,h,d,y,v,w,b,S,x,M,E=e.length;for(o=i(e),a=o.real,u=o.imag,M=1;E>M;){for(p=g(l/M),h=(t?-1:1)*m(l/M),r=0;E/(2*M)>r;r++)for(s=1,c=0,n=0;M>n;n++)y=2*r*M+n,v=y+M,w=a[y],b=u[y],S=s*a[v]-c*u[v],x=c*a[v]+s*u[v],a[y]=f*(w+S),u[y]=f*(b+x),a[v]=f*(w-S),u[v]=f*(b-x),d=s*p-c*h,c=s*h+c*p,s=d;M<<=1}return o}function u(e,t){for(var r=0;t>1;)r<<=1,r+=1&e,e>>=1,t>>=1;return r}function i(e){var t,r,n=e.length,o={};for(r=0;n>r;r++){var a=u(r,n);o.hasOwnProperty(r)||o.hasOwnProperty(a)||(t=e.real[a],e.real[a]=e.real[r],e.real[r]=t,t=e.imag[a],e.imag[a]=e.imag[r],e.imag[r]=t,o[r]=o[a]=!0)}return e}function s(e){for(var t=3,r=p(e);r>=t;){if(e%t===0)return t;t+=2}return e}var c=t.ComplexArray,l=Math.PI,f=Math.SQRT1_2,p=Math.sqrt,g=Math.cos,m=Math.sin;c.prototype.FFT=function(){return n(this,!1)},e.FFT=function(e){return r(e).FFT()},c.prototype.InvFFT=function(){return n(this,!0)},e.InvFFT=function(e){return r(e).InvFFT()},c.prototype.frequencyMap=function(e){return this.FFT().map(e).InvFFT()},e.frequencyMap=function(e,t){return r(e).frequencyMap(t)}}("undefined"==typeof r&&(this.fft={})||r,"undefined"==typeof e&&this.complex_array||e("./complex_array"))},{"./complex_array":6}],8:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}Object.defineProperty(r,"__esModule",{value:!0});var o=e("assert");n(o);r["default"]=function(){if("object"!=typeof arguments[0].signal)throw new TypeError;for(var e=0,t=0;t<arguments[0].signal.length;t++)e+=Math.pow(Math.abs(arguments[0].signal[t]),2);return e},t.exports=r["default"]},{assert:1}],9:[function(e,t,r){"use strict";function n(e,t){for(var r=0,n=0,o=0;o<t.length;o++)r+=Math.pow(o,e)*Math.abs(t[o]),n+=t[o];return r/n}Object.defineProperty(r,"__esModule",{value:!0}),r.mu=n},{}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;var t=24,r=new Float32Array(t),n=0,o=e.ampSpectrum,a=new Int32Array(t+1);a[0]=0;for(var u=e.barkScale[o.length-1]/t,i=1,s=0;s<o.length;s++)for(;e.barkScale[s]>u;)a[i++]=s,u=i*e.barkScale[o.length-1]/t;a[t]=o.length-1;for(var s=0;t>s;s++){for(var c=0,l=a[s];l<a[s+1];l++)c+=o[l];r[s]=Math.pow(c,.23)}for(var s=0;s<r.length;s++)n+=r[s];return{specific:r,total:n}},t.exports=r["default"]},{}],11:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./powerSpectrum"),a=n(o),u=function(e){var t=700*(Math.exp(e/1125)-1);return t},i=function(e){var t=1125*Math.log(1+e/700);return t};r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;for(var t=a["default"](e),r=26,n=new Float32Array(r+2),o=new Float32Array(r+2),s=0,c=e.sampleRate/2,l=i(s),f=i(c),p=f-l,g=p/(r+1),m=Array(r+2),h=0;h<n.length;h++)n[h]=h*g,o[h]=u(n[h]),m[h]=Math.floor((e.bufferSize+1)*o[h]/e.sampleRate);for(var d=Array(r),y=0;y<d.length;y++){d[y]=Array.apply(null,new Array(e.bufferSize/2+1)).map(Number.prototype.valueOf,0);for(var h=m[y];h<m[y+1];h++)d[y][h]=(h-m[y])/(m[y+1]-m[y]);for(var h=m[y+1];h<m[y+2];h++)d[y][h]=(m[y+2]-h)/(m[y+2]-m[y+1])}for(var v=new Float32Array(r),h=0;h<v.length;h++){v[h]=0;for(var y=0;y<e.bufferSize/2;y++)d[h][y]=d[h][y]*t[y],v[h]+=d[h][y];v[h]=Math.log(v[h])}for(var w=Math.PI/r,b=1/Math.sqrt(r),S=Math.sqrt(2/r),x=13,M=new Float32Array(x*r),h=0;x>h;h++)for(var y=0;r>y;y++){var E=h+y*x;0===h?M[E]=b*Math.cos(w*(h+1)*(y+.5)):M[E]=S*Math.cos(w*(h+1)*(y+.5))}for(var _=new Float32Array(x),j=0;x>j;j++){for(var O=0,T=0;r>T;T++){var E=j+T*x;O+=M[E]*v[T]}_[j]=O/x}return _},t.exports=r["default"]},{"./powerSpectrum":14}],12:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./loudness"),a=n(o);r["default"]=function(){if("object"!=typeof arguments[0].signal)throw new TypeError;for(var e=a["default"](arguments[0]),t=e.specific,r=0,n=0;n<t.length;n++)r+=15>n?(n+1)*t[n+1]:.066*Math.exp(.171*(n+1));return r*=.11/e.total},t.exports=r["default"]},{"./loudness":10}],13:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./loudness"),a=n(o);r["default"]=function(){if("object"!=typeof arguments[0].signal)throw new TypeError;for(var e=a["default"](arguments[0]),t=0,r=0;r<e.specific.length;r++)e.specific[r]>t&&(t=e.specific[r]);var n=Math.pow((e.total-t)/e.total,2);return n},t.exports=r["default"]},{"./loudness":10}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;for(var e=new Float32Array(arguments[0].ampSpectrum.length),t=0;t<e.length;t++)e[t]=Math.pow(arguments[0].ampSpectrum[t],2);return e},t.exports=r["default"]},{}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(e){if("object"!=typeof e.signal)throw new TypeError;for(var t=0,r=0;r<e.signal.length;r++)t+=Math.pow(e.signal[r],2);return t/=e.signal.length,t=Math.sqrt(t)},t.exports=r["default"]},{}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./extractorUtilities");r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;return n.mu(1,arguments[0].ampSpectrum)},t.exports=r["default"]},{"./extractorUtilities":9}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;for(var e=0,t=0,r=0;r<arguments[0].ampSpectrum.length;r++)e+=Math.log(arguments[0].ampSpectrum[r]),t+=arguments[0].ampSpectrum[r];return Math.exp(e/arguments[0].ampSpectrum.length)*arguments[0].ampSpectrum.length/t},t.exports=r["default"]},{}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./extractorUtilities");r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;var e=arguments[0].ampSpectrum,t=n.mu(1,e),r=n.mu(2,e),o=n.mu(3,e),a=n.mu(4,e),u=-3*Math.pow(t,4)+6*t*r-4*t*o+a,i=Math.pow(Math.sqrt(r-Math.pow(t,2)),4);return u/i},t.exports=r["default"]},{"./extractorUtilities":9}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!=typeof arguments[0].ampSpectrum)throw new TypeError;for(var e=arguments[0].ampSpectrum,t=arguments[0].sampleRate/(2*(e.length-1)),r=0,n=0;n<e.length;n++)r+=e[n];for(var o=.99*r,a=e.length-1;r>o&&a>=0;)r-=e[a],--a;return(a+1)*t},t.exports=r["default"]},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./extractorUtilities");r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;var t=n.mu(1,e.ampSpectrum),r=n.mu(2,e.ampSpectrum),o=n.mu(3,e.ampSpectrum),a=2*Math.pow(t,3)-3*t*r+o,u=Math.pow(Math.sqrt(r-Math.pow(t,2)),3);return a/u},t.exports=r["default"]},{"./extractorUtilities":9}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;for(var t=0,r=0,n=new Float32Array(e.ampSpectrum.length),o=0,a=0,u=0;u<e.ampSpectrum.length;u++){t+=e.ampSpectrum[u];var i=u*e.sampleRate/e.bufferSize;n[u]=i,o+=i*i,r+=i,a+=i*e.ampSpectrum[u]}return(e.ampSpectrum.length*a-r*t)/(t*(o-Math.pow(r,2)))},t.exports=r["default"]},{}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./extractorUtilities");r["default"]=function(e){if("object"!=typeof e.ampSpectrum)throw new TypeError;return Math.sqrt(n.mu(2,e.ampSpectrum)-Math.pow(n.mu(1,e.ampSpectrum),2))},t.exports=r["default"]},{"./extractorUtilities":9}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=function(){if("object"!=typeof arguments[0].signal)throw new TypeError;for(var e=0,t=0;t<arguments[0].signal.length;t++)(arguments[0].signal[t]>=0&&arguments[0].signal[t+1]<0||arguments[0].signal[t]<0&&arguments[0].signal[t+1]>=0)&&e++;return e},t.exports=r["default"]},{}],24:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./extractors/rms"),a=n(o),u=e("./extractors/energy"),i=n(u),s=e("./extractors/spectralSlope"),c=n(s),l=e("./extractors/spectralCentroid"),f=n(l),p=e("./extractors/spectralRolloff"),g=n(p),m=e("./extractors/spectralFlatness"),h=n(m),d=e("./extractors/spectralSpread"),y=n(d),v=e("./extractors/spectralSkewness"),w=n(v),b=e("./extractors/spectralKurtosis"),S=n(b),x=e("./extractors/zcr"),M=n(x),E=e("./extractors/loudness"),_=n(E),j=e("./extractors/perceptualSpread"),O=n(j),T=e("./extractors/perceptualSharpness"),A=n(T),F=e("./extractors/mfcc"),P=n(F),k=e("./extractors/powerSpectrum"),z=n(k);r["default"]={buffer:function(e){return e.signal},rms:a["default"],energy:i["default"],complexSpectrum:function(e){return e.complexSpectrum},spectralSlope:c["default"],spectralCentroid:f["default"],spectralRolloff:g["default"],spectralFlatness:h["default"],spectralSpread:y["default"],spectralSkewness:w["default"],spectralKurtosis:S["default"],amplitudeSpectrum:function(e){return e.ampSpectrum},zcr:M["default"],loudness:_["default"],perceptualSpread:O["default"],perceptualSharpness:A["default"],powerSpectrum:z["default"],mfcc:P["default"]},t.exports=r["default"]},{"./extractors/energy":8,"./extractors/loudness":10,"./extractors/mfcc":11,"./extractors/perceptualSharpness":12,"./extractors/perceptualSpread":13,"./extractors/powerSpectrum":14,"./extractors/rms":15,"./extractors/spectralCentroid":16,"./extractors/spectralFlatness":17,"./extractors/spectralKurtosis":18,"./extractors/spectralRolloff":19,"./extractors/spectralSkewness":20,"./extractors/spectralSlope":21,"./extractors/spectralSpread":22,"./extractors/zcr":23}],25:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e("./utilities"),s=o(i),c=e("./featureExtractors"),l=n(c),f=e("jsfft"),p=(o(f),e("jsfft/lib/complex_array")),g=o(p),m=function(){function e(t){a(this,e);var r=this;r.audioContext=t.audioContext,r.spn=r.audioContext.createScriptProcessor(r.bufferSize,1,1),r.spn.connect(r.audioContext.destination),r.setSource(t.source),r.bufferSize=t.bufferSize||256,r.callback=t.callback,r.windowingFunction=t.windowingFunction||"hanning",r.featureExtractors=l["default"],r.EXTRACTION_STARTED=t.startImmediately||!1,r._featuresToExtract=t.featureExtractors||[],r.barkScale=new Float32Array(r.bufferSize);for(var n=0;n<r.barkScale.length;n++)r.barkScale[n]=n*r.audioContext.sampleRate/r.bufferSize,r.barkScale[n]=13*Math.atan(r.barkScale[n]/1315.8)+3.5*Math.atan(Math.pow(r.barkScale[n]/7518,2));r.spn.onaudioprocess=function(e){var t=e.inputBuffer.getChannelData(0);r.signal=t;var n=s.applyWindow(t,r.windowingFunction),o=new g.ComplexArray(r.bufferSize);o.map(function(e,t,r){e.real=n[t]});var a=o.FFT();r.complexSpectrum=a,r.ampSpectrum=new Float32Array(r.bufferSize/2);for(var u=0;u<r.bufferSize/2;u++)r.ampSpectrum[u]=Math.sqrt(Math.pow(a.real[u],2)+Math.pow(a.imag[u],2));"function"==typeof r.callback&&r.EXTRACTION_STARTED&&r.callback(r.get(r._featuresToExtract))}}return u(e,[{key:"start",value:function(e){self._featuresToExtract=e,self.EXTRACTION_STARTED=!0}},{key:"stop",value:function(){self.EXTRACTION_STARTED=!1}},{key:"setSource",value:function(e){e.connect(this.spn)}},{key:"get",value:function(e){var t=this;if("object"==typeof e){for(var r={},n=0;n<e.length;n++)r[e[n]]=l["default"][e[n]]({ampSpectrum:t.ampSpectrum,complexSpectrum:t.complexSpectrum,signal:t.signal,bufferSize:t.bufferSize,sampleRate:t.audioContext.sampleRate,barkScale:t.barkScale});return r}if("string"==typeof e)return l["default"][e]({ampSpectrum:t.ampSpectrum,complexSpectrum:t.complexSpectrum,signal:t.signal,bufferSize:t.bufferSize,sampleRate:t.audioContext.sampleRate,barkScale:t.barkScale});throw"Invalid Feature Format"}}]),e}();r["default"]=m,"undefined"!=typeof window&&(window.Meyda=m),t.exports=r["default"]},{"./featureExtractors":24,"./utilities":26,jsfft:7,"jsfft/lib/complex_array":6}],26:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){for(;e%2===0&&e>1;)e/=2;return 1===e}function a(e){throw new Error("Meyda: "+e)}function u(e,t){for(var r=[],n=0;n<Math.min(e.length,t.length);n++)r[n]=e[n]*t[n];return r}function i(e,t){return l[t]||(l[t]={}),l[t][e.length]||(l[t][e.length]=c.hanning(e.length)),u(e,l[t][e.length])}Object.defineProperty(r,"__esModule",{value:!0}),r.isPowerOfTwo=o,r.error=a,r.pointwiseBufferMult=u,r.applyWindow=i;var s=e("./windowing"),c=n(s),l={}},{"./windowing":27}],27:[function(e,t,r){"use strict";function n(e){for(var t=new Float32Array(e),r=0;e>r;r++)t[r]=.5-.5*Math.cos(2*Math.PI*r/(e-1));return t}function o(e){for(var t=new Float32Array(e),r=0;e>r;r++)t[r]=.54-.46*Math.cos(2*Math.PI*(r/e-1));return t}Object.defineProperty(r,"__esModule",{value:!0}),r.hanning=n,r.hamming=o},{}]},{},[25]); |
{ | ||
"name": "meyda", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Real-time feature extraction for the web audio api", | ||
"main": "./dist/node/main.js", | ||
"scripts": { | ||
"test": "make test" | ||
"pretest": "npm run build && npm run lint", | ||
"test":"./node_modules/.bin/mocha --recursive test", | ||
"build":"npm run buildWeb && npm run buildNode", | ||
"buildWeb":"mkdir -p dist/web && ./node_modules/.bin/gulp buildWeb && ./node_modules/.bin/gulp uglifyWeb", | ||
"buildNode":"mkdir -p dist/node && ./node_modules/.bin/gulp buildNode", | ||
"coverage":"./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --recursive test --report lcovonly -- -R spec && cat ./coverage/lcov.info && ./node_modules/.bin/codeclimate-test-reporter < ./coverage/lcov.info", | ||
"default":"npm run clean && npm install && npm test", | ||
"lint":"./node_modules/.bin/jshint src test", | ||
"clean":"rm -rf dist node_modules src-cov coverage lib-cov" | ||
}, | ||
@@ -34,3 +42,3 @@ "repository": { | ||
"babelify": "^6.1.2", | ||
"browserify": "^10.2.4", | ||
"browserify": "^11.0.1 ", | ||
"chai": "^3.1.0", | ||
@@ -42,5 +50,5 @@ "codeclimate-test-reporter": "^0.1.0", | ||
"gulp-sourcemaps": "^1.5.2", | ||
"gulp-uglify": "^1.2.0", | ||
"gulp-uglify": "^1.3.0", | ||
"istanbul": "^0.3.17", | ||
"jscoverage": "^0.5.9", | ||
"jscoverage": "^0.6.0", | ||
"jshint": "^2.8.0", | ||
@@ -47,0 +55,0 @@ "mocha": "^2.2.5", |
@@ -21,6 +21,6 @@ import * as utilities from './utilities'; | ||
self.featureExtractors = featureExtractors; | ||
self.EXTRACTION_STARTED = options.startImmediately || false; | ||
//callback controllers | ||
var EXTRACTION_STARTED = false; | ||
var _featuresToExtract; | ||
self._featuresToExtract = options.featureExtractors || []; | ||
@@ -55,4 +55,4 @@ self.barkScale = new Float32Array(self.bufferSize); | ||
// call callback if applicable | ||
if (typeof callback === "function" && EXTRACTION_STARTED) { | ||
callback(self.get(_featuresToExtract)); | ||
if (typeof self.callback === "function" && self.EXTRACTION_STARTED) { | ||
self.callback(self.get(self._featuresToExtract)); | ||
} | ||
@@ -63,8 +63,8 @@ }; | ||
start(features) { | ||
_featuresToExtract = features; | ||
EXTRACTION_STARTED = true; | ||
self._featuresToExtract = features; | ||
self.EXTRACTION_STARTED = true; | ||
} | ||
stop() { | ||
EXTRACTION_STARTED = false; | ||
self.EXTRACTION_STARTED = false; | ||
} | ||
@@ -109,2 +109,3 @@ | ||
export default Meyda; | ||
if(typeof window !== 'undefined') window.Meyda = Meyda; | ||
if (typeof window !== "undefined") window.Meyda = Meyda; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
404972
80