<commit_before><commit_msg>Update project AudioFX to v0.0.4<commit_after>!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.AudioFX=e()}(this,function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var e=function(){function t(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,o,i){return o&&t(e.prototype,o),i&&t(e,i),e}}(),o=function(){function o(e,i,n){t(this,o),this["const"]={QUALITY_MULTIPLIER:30};var r={loop:!1,filterFrequency:null,autoplay:!1};if(this.options=o.isObject(n)?o.extend(r,n):r,this.playing=!1,this.hasLoaded=!1,!window.AudioFXGlobal){window.AudioFXGlobal={};try{window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioFXGlobal.context=new AudioContext}catch(s){o.error("Web Audio API Error: "+s.message)}}"string"!=typeof e?o.error("You have to provide a valid url string."):this.url=e,i&&(o.isFunction(i)?this.onload=i:o.error("Supplied callback is not a function.")),this.buffer=null,this.duration=0,this.source=null,window.AudioFXGlobal.context.createGain||(window.AudioFXGlobal.context.createGain=window.AudioFXGlobal.context.createGainNode),this.gainNode=window.AudioFXGlobal.context.createGain(),this.filterNode=window.AudioFXGlobal.context.createBiquadFilter(),this.filterNode.type="string"==typeof this.filterNode.type?"lowpass":0,this.filterNode.frequency.value=this.options.filterFrequency?this.options.filterFrequency:window.AudioFXGlobal.context.sampleRate,this._pauseTime=0,this.loadFile(e)}return e(o,[{key:"loadFile",value:function(t){this.request=new XMLHttpRequest,this.request.open("GET",t,!0),this.request.responseType="arraybuffer";var e=this;this.request.onload=function(){window.AudioFXGlobal.context.decodeAudioData(e.request.response,function(i){i||o.error("Error decoding file data: "+t),e.buffer=i,e.duration=parseFloat(i.duration),e.hasLoaded=!0,e.options.autoplay===!0&&e.play(),o.isFunction(e.onload)&&e.onload(e)},function(t){o.error("Error at decodeAudioData"+t)})},this.request.onerror=function(){o.error("XMLHttpRequest errored. Readystate: "+this.readyState+". Status: "+this.status)},this.request.send()}},{key:"createAndConnectNodes",value:function(){this.source=window.AudioFXGlobal.context.createBufferSource(),this.source.buffer=this.buffer,this.source.connect(this.filterNode),this.filterNode.connect(this.gainNode),this.gainNode.connect(window.AudioFXGlobal.context.destination)}},{key:"play",value:function(){var t=void 0===arguments[0]?0:arguments[0];return this.playing===!0&&this.stop(),this.createAndConnectNodes(),this.options.loop&&(this.source.loop=!0),this.source.start||(this.source.start=this.source.noteOn),this._pauseTime?this.source.start(0,this._pauseTime):this.source.start(0,t),this._playTime=window.AudioFXGlobal.context.currentTime,this.playing=!0,this}},{key:"pause",value:function(){if(this._playTime){var t=window.AudioFXGlobal.context.currentTime-this._playTime;this._pauseTime=this._pauseTime+t,this.source.stop||(this.source.stop=this.source.noteOff),this.source.stop(),this.playing=!1}}},{key:"stop",value:function(){var t=void 0===arguments[0]?0:arguments[0];return this.source.stop||(this.source.stop=this.source.noteOff),this._pauseTime=null,this.source.stop(t),this.playing=!1,this}},{key:"toggle",value:function(){return this.playing===!0?this.pause():this.play(),this}},{key:"changeVolume",value:function(t){var e=parseFloat(t);return e>1?e=1:0>e&&(e=0),this.gainNode.gain.value=e*e,this}},{key:"changeFilter",value:function(t,e){var o=40,i=window.AudioFXGlobal.context.sampleRate/2,n=Math.log(i/o)/Math.LN2,r=Math.pow(2,n*(t-1));return this.filterNode.frequency.value=i*r,this.filterNode.Q.value=e*this["const"].QUALITY_MULTIPLIER,this}},{key:"getCurrentTime",value:function(){return this.playing?this._pauseTime+(window.AudioFXGlobal.context.currentTime-this._playTime):this._pauseTime}},{key:"getDuration",value:function(){return this.duration}},{key:"destroy",value:function(){this.playing&&this.stop();for(var t in this)this.hasOwnProperty(t)&&delete this[t]}},{key:"volume",value:function(t){return this.changeVolume(t)}},{key:"filter",value:function(t,e){return this.changeFilter(t,e)}},{key:"kill",value:function(){return this.destroy()}},{key:"remove",value:function(){return this.destroy()}}],[{key:"extend",value:function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}},{key:"isObject",value:function(t){return null!==t&&"object"==typeof t}},{key:"isFunction",value:function(t){var e={};return t&&"[object Function]"===e.toString.call(t)}},{key:"error",value:function(t){throw new Error("AudioFX: Error! "+t)}}]),o}();return o});
{'fraction_non_alphanumeric': 0.21788752853289065, 'fraction_numerical': 0.009338036937123885, 'mean_word_length': 14.4983922829582, 'pattern_counts': {'":': 1, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3609592', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1655, 'n_words': 97}