Apply sample rate conversion if system sample rate doesn't match.
diff --git a/chrome-extension/espeak_tts_engine.js b/chrome-extension/espeak_tts_engine.js
index 15b6397..84c8e1d 100644
--- a/chrome-extension/espeak_tts_engine.js
+++ b/chrome-extension/espeak_tts_engine.js
@@ -301,6 +301,8 @@
         options.voiceName, options.lang);
     this.tts_.set_voice(espeakVoiceName);
 
+    this.tts_.set_systemSampleRate(this.context_.sampleRate);
+
     // Chrome TTS rates range from 0.1 to 10.0, with 1.0 as the default.
     // eSpeak rates range from 80 to 450, with 175 as the default.
     var rate = Math.min(Math.max(Math.floor(options.rate * 175), 80), 450);
@@ -321,9 +323,6 @@
         if (events) {
           events.forEach((function(event) {
             switch (event.type) {
-            case 'samplerate':
-              // Incomplete?
-              break;
             case 'sentence':
             case 'word':
               this.scheduleTimepointEvent(
@@ -388,6 +387,7 @@
 
     var i = 0;
     var len = samples.length;
+
     var didSendBuffers = false;
     while (i < len) {
       var chunkLen = Math.min(this.bufferLen_ - this.currentBufferIndex_,
@@ -395,7 +395,8 @@
       if (!this.currentBuffer_) {
         this.currentBuffer_ = new Float32Array(this.bufferLen_);
       }
-      this.currentBuffer_.set(samples.subarray(i, i + chunkLen), this.currentBufferIndex_);
+      this.currentBuffer_.set(samples.subarray(i, i + chunkLen),
+                              this.currentBufferIndex_);
       i += chunkLen;
       this.currentBufferIndex_ += chunkLen;
       if (this.currentBufferIndex_ == this.bufferLen_) {
diff --git a/chrome-extension/js/espeakng.js b/chrome-extension/js/espeakng.js
index a225835..32e5b88 100644
--- a/chrome-extension/js/espeakng.js
+++ b/chrome-extension/js/espeakng.js
@@ -63,6 +63,7 @@
     'set_rate',
     'set_pitch',
     'set_voice',
+    'set_systemSampleRate',
     'synthesize',
     'synthesize_ipa'
     ]) {
diff --git a/chrome-extension/js/espeakng.worker.data b/chrome-extension/js/espeakng.worker.data
index 43f8650..6a04fa1 100644
--- a/chrome-extension/js/espeakng.worker.data
+++ b/chrome-extension/js/espeakng.worker.data
Binary files differ
diff --git a/chrome-extension/js/espeakng.worker.js b/chrome-extension/js/espeakng.worker.js
index 14b4c3f..0ab1422 100644
--- a/chrome-extension/js/espeakng.worker.js
+++ b/chrome-extension/js/espeakng.worker.js
@@ -1,4 +1,4 @@
-var Module=typeof Module!=="undefined"?Module:{};var Module=typeof Module!=="undefined"?Module:{};if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0;Module.finishedDataFileDownloads=0}Module.expectedDataFileDownloads++;((function(){var loadPackage=(function(metadata){var PACKAGE_PATH;if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}else{throw"using preloaded data can only be done on a web page or in a web worker"}var PACKAGE_NAME="js/espeakng.worker.data";var REMOTE_PACKAGE_BASE="espeakng.worker.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];Module.printErr("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=typeof Module["locateFile"]==="function"?Module["locateFile"](REMOTE_PACKAGE_BASE):(Module["filePackagePrefixURL"]||"")+REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata.remote_package_size;var PACKAGE_UUID=metadata.package_uuid;function fetchRemotePackage(packageName,packageSize,callback,errback){var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=(function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}});xhr.onerror=(function(event){throw new Error("NetworkError for: "+packageName)});xhr.onload=(function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}});xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,(function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}}),handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","usr",true,true);Module["FS_createPath"]("/usr","share",true,true);Module["FS_createPath"]("/usr/share","espeak-ng-data",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data","voices",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/voices","!v",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/voices","mb",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data","lang",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","esx",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","bat",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","aav",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","poz",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","roa",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","cus",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","sai",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","dra",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","art",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","azc",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","zlw",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","bnt",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","zls",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","tai",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","gmq",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","cel",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","inc",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","gmw",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","ine",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","urj",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","sit",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","jpx",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","ira",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","sem",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","grk",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","itc",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","zle",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","ccs",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","trk",true,true);function DataRequest(start,end,crunched,audio){this.start=start;this.end=end;this.crunched=crunched;this.audio=audio}DataRequest.prototype={requests:{},open:(function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)}),send:(function(){}),onload:(function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)}),finish:(function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null})};var files=metadata.files;for(var i=0;i<files.length;++i){(new DataRequest(files[i].start,files[i].end,files[i].crunched,files[i].audio)).open("GET",files[i].filename)}function processPackageData(arrayBuffer){Module.finishedDataFileDownloads++;assert(arrayBuffer,"Loading data file failed.");assert(arrayBuffer instanceof ArrayBuffer,"bad input to processPackageData");var byteArray=new Uint8Array(arrayBuffer);if(Module["SPLIT_MEMORY"])Module.printErr("warning: you should run the file packager with --no-heap-copy when SPLIT_MEMORY is used, otherwise copying into the heap may fail due to the splitting");var ptr=Module["getMemory"](byteArray.length);Module["HEAPU8"].set(byteArray,ptr);DataRequest.prototype.byteArray=Module["HEAPU8"].subarray(ptr,ptr+byteArray.length);var files=metadata.files;for(var i=0;i<files.length;++i){DataRequest.prototype.requests[files[i].filename].onload()}Module["removeRunDependency"]("datafile_js/espeakng.worker.data")}Module["addRunDependency"]("datafile_js/espeakng.worker.data");if(!Module.preloadResults)Module.preloadResults={};Module.preloadResults[PACKAGE_NAME]={fromCache:false};if(fetched){processPackageData(fetched);fetched=null}else{fetchedCallback=processPackageData}}if(Module["calledRun"]){runWithFS()}else{if(!Module["preRun"])Module["preRun"]=[];Module["preRun"].push(runWithFS)}});loadPackage({"files":[{"audio":0,"start":0,"crunched":0,"end":87391,"filename":"/usr/share/espeak-ng-data/mr_dict"},{"audio":0,"start":87391,"crunched":0,"end":208869,"filename":"/usr/share/espeak-ng-data/af_dict"},{"audio":0,"start":208869,"crunched":0,"end":211514,"filename":"/usr/share/espeak-ng-data/kl_dict"},{"audio":0,"start":211514,"crunched":0,"end":377945,"filename":"/usr/share/espeak-ng-data/en_dict"},{"audio":0,"start":377945,"crunched":0,"end":421403,"filename":"/usr/share/espeak-ng-data/id_dict"},{"audio":0,"start":421403,"crunched":0,"end":488035,"filename":"/usr/share/espeak-ng-data/de_dict"},{"audio":0,"start":488035,"crunched":0,"end":490163,"filename":"/usr/share/espeak-ng-data/pap_dict"},{"audio":0,"start":490163,"crunched":0,"end":699716,"filename":"/usr/share/espeak-ng-data/ta_dict"},{"audio":0,"start":699716,"crunched":0,"end":1227780,"filename":"/usr/share/espeak-ng-data/phondata"},{"audio":0,"start":1227780,"crunched":0,"end":1319923,"filename":"/usr/share/espeak-ng-data/hi_dict"},{"audio":0,"start":1319923,"crunched":0,"end":1369307,"filename":"/usr/share/espeak-ng-data/phontab"},{"audio":0,"start":1369307,"crunched":0,"end":1433166,"filename":"/usr/share/espeak-ng-data/mk_dict"},{"audio":0,"start":1433166,"crunched":0,"end":1528003,"filename":"/usr/share/espeak-ng-data/te_dict"},{"audio":0,"start":1528003,"crunched":0,"end":1530084,"filename":"/usr/share/espeak-ng-data/ia_dict"},{"audio":0,"start":1530084,"crunched":0,"end":1610045,"filename":"/usr/share/espeak-ng-data/pa_dict"},{"audio":0,"start":1610045,"crunched":0,"end":1697877,"filename":"/usr/share/espeak-ng-data/kn_dict"},{"audio":0,"start":1697877,"crunched":0,"end":1989923,"filename":"/usr/share/espeak-ng-data/fa_dict"},{"audio":0,"start":1989923,"crunched":0,"end":2068090,"filename":"/usr/share/espeak-ng-data/zh_dict"},{"audio":0,"start":2068090,"crunched":0,"end":2117735,"filename":"/usr/share/espeak-ng-data/cs_dict"},{"audio":0,"start":2117735,"crunched":0,"end":2185557,"filename":"/usr/share/espeak-ng-data/pt_dict"},{"audio":0,"start":2185557,"crunched":0,"end":2229537,"filename":"/usr/share/espeak-ng-data/fi_dict"},{"audio":0,"start":2229537,"crunched":0,"end":2232904,"filename":"/usr/share/espeak-ng-data/grc_dict"},{"audio":0,"start":2232904,"crunched":0,"end":2239600,"filename":"/usr/share/espeak-ng-data/an_dict"},{"audio":0,"start":2239600,"crunched":0,"end":2242744,"filename":"/usr/share/espeak-ng-data/gn_dict"},{"audio":0,"start":2242744,"crunched":0,"end":2247749,"filename":"/usr/share/espeak-ng-data/as_dict"},{"audio":0,"start":2247749,"crunched":0,"end":2249806,"filename":"/usr/share/espeak-ng-data/jbo_dict"},{"audio":0,"start":2249806,"crunched":0,"end":2252878,"filename":"/usr/share/espeak-ng-data/tn_dict"},{"audio":0,"start":2252878,"crunched":0,"end":2298444,"filename":"/usr/share/espeak-ng-data/ca_dict"},{"audio":0,"start":2298444,"crunched":0,"end":2366982,"filename":"/usr/share/espeak-ng-data/ro_dict"},{"audio":0,"start":2366982,"crunched":0,"end":2439757,"filename":"/usr/share/espeak-ng-data/el_dict"},{"audio":0,"start":2439757,"crunched":0,"end":2503635,"filename":"/usr/share/espeak-ng-data/am_dict"},{"audio":0,"start":2503635,"crunched":0,"end":2505937,"filename":"/usr/share/espeak-ng-data/om_dict"},{"audio":0,"start":2505937,"crunched":0,"end":2507471,"filename":"/usr/share/espeak-ng-data/nci_dict"},{"audio":0,"start":2507471,"crunched":0,"end":2556062,"filename":"/usr/share/espeak-ng-data/eu_dict"},{"audio":0,"start":2556062,"crunched":0,"end":2604827,"filename":"/usr/share/espeak-ng-data/es_dict"},{"audio":0,"start":2604827,"crunched":0,"end":2850122,"filename":"/usr/share/espeak-ng-data/da_dict"},{"audio":0,"start":2850122,"crunched":0,"end":2942467,"filename":"/usr/share/espeak-ng-data/ml_dict"},{"audio":0,"start":2942467,"crunched":0,"end":2996008,"filename":"/usr/share/espeak-ng-data/ms_dict"},{"audio":0,"start":2996008,"crunched":0,"end":3001234,"filename":"/usr/share/espeak-ng-data/bpy_dict"},{"audio":0,"start":3001234,"crunched":0,"end":3047648,"filename":"/usr/share/espeak-ng-data/ja_dict"},{"audio":0,"start":3047648,"crunched":0,"end":3100285,"filename":"/usr/share/espeak-ng-data/ga_dict"},{"audio":0,"start":3100285,"crunched":0,"end":3147357,"filename":"/usr/share/espeak-ng-data/bs_dict"},{"audio":0,"start":3147357,"crunched":0,"end":3209406,"filename":"/usr/share/espeak-ng-data/hy_dict"},{"audio":0,"start":3209406,"crunched":0,"end":3215800,"filename":"/usr/share/espeak-ng-data/kok_dict"},{"audio":0,"start":3215800,"crunched":0,"end":3369585,"filename":"/usr/share/espeak-ng-data/hu_dict"},{"audio":0,"start":3369585,"crunched":0,"end":3412715,"filename":"/usr/share/espeak-ng-data/cy_dict"},{"audio":0,"start":3412715,"crunched":0,"end":3414836,"filename":"/usr/share/espeak-ng-data/tt_dict"},{"audio":0,"start":3414836,"crunched":0,"end":3495663,"filename":"/usr/share/espeak-ng-data/ur_dict"},{"audio":0,"start":3495663,"crunched":0,"end":3582714,"filename":"/usr/share/espeak-ng-data/bg_dict"},{"audio":0,"start":3582714,"crunched":0,"end":3647135,"filename":"/usr/share/espeak-ng-data/ky_dict"},{"audio":0,"start":3647135,"crunched":0,"end":3649928,"filename":"/usr/share/espeak-ng-data/lfn_dict"},{"audio":0,"start":3649928,"crunched":0,"end":3699049,"filename":"/usr/share/espeak-ng-data/gd_dict"},{"audio":0,"start":3699049,"crunched":0,"end":3700857,"filename":"/usr/share/espeak-ng-data/ht_dict"},{"audio":0,"start":3700857,"crunched":0,"end":3790103,"filename":"/usr/share/espeak-ng-data/or_dict"},{"audio":0,"start":3790103,"crunched":0,"end":3794487,"filename":"/usr/share/espeak-ng-data/mt_dict"},{"audio":0,"start":3794487,"crunched":0,"end":3860471,"filename":"/usr/share/espeak-ng-data/nl_dict"},{"audio":0,"start":3860471,"crunched":0,"end":3862739,"filename":"/usr/share/espeak-ng-data/ku_dict"},{"audio":0,"start":3862739,"crunched":0,"end":3909575,"filename":"/usr/share/espeak-ng-data/sr_dict"},{"audio":0,"start":3909575,"crunched":0,"end":4386555,"filename":"/usr/share/espeak-ng-data/ar_dict"},{"audio":0,"start":4386555,"crunched":0,"end":4431602,"filename":"/usr/share/espeak-ng-data/sl_dict"},{"audio":0,"start":4431602,"crunched":0,"end":4493792,"filename":"/usr/share/espeak-ng-data/ru_dict"},{"audio":0,"start":4493792,"crunched":0,"end":4538795,"filename":"/usr/share/espeak-ng-data/sq_dict"},{"audio":0,"start":4538795,"crunched":0,"end":4542601,"filename":"/usr/share/espeak-ng-data/la_dict"},{"audio":0,"start":4542601,"crunched":0,"end":4547267,"filename":"/usr/share/espeak-ng-data/eo_dict"},{"audio":0,"start":4547267,"crunched":0,"end":4632651,"filename":"/usr/share/espeak-ng-data/si_dict"},{"audio":0,"start":4632651,"crunched":0,"end":4634223,"filename":"/usr/share/espeak-ng-data/shn_dict"},{"audio":0,"start":4634223,"crunched":0,"end":4716703,"filename":"/usr/share/espeak-ng-data/gu_dict"},{"audio":0,"start":4716703,"crunched":0,"end":4806686,"filename":"/usr/share/espeak-ng-data/bn_dict"},{"audio":0,"start":4806686,"crunched":0,"end":4902071,"filename":"/usr/share/espeak-ng-data/ne_dict"},{"audio":0,"start":4902071,"crunched":0,"end":4903839,"filename":"/usr/share/espeak-ng-data/intonations"},{"audio":0,"start":4903839,"crunched":0,"end":4951362,"filename":"/usr/share/espeak-ng-data/ko_dict"},{"audio":0,"start":4951362,"crunched":0,"end":5047310,"filename":"/usr/share/espeak-ng-data/my_dict"},{"audio":0,"start":5047310,"crunched":0,"end":5091664,"filename":"/usr/share/espeak-ng-data/is_dict"},{"audio":0,"start":5091664,"crunched":0,"end":5150347,"filename":"/usr/share/espeak-ng-data/sd_dict"},{"audio":0,"start":5150347,"crunched":0,"end":5202713,"filename":"/usr/share/espeak-ng-data/vi_dict"},{"audio":0,"start":5202713,"crunched":0,"end":5206891,"filename":"/usr/share/espeak-ng-data/no_dict"},{"audio":0,"start":5206891,"crunched":0,"end":5251154,"filename":"/usr/share/espeak-ng-data/et_dict"},{"audio":0,"start":5251154,"crunched":0,"end":5338643,"filename":"/usr/share/espeak-ng-data/ka_dict"},{"audio":0,"start":5338643,"crunched":0,"end":5341978,"filename":"/usr/share/espeak-ng-data/hak_dict"},{"audio":0,"start":5341978,"crunched":0,"end":5389814,"filename":"/usr/share/espeak-ng-data/sv_dict"},{"audio":0,"start":5389814,"crunched":0,"end":5433587,"filename":"/usr/share/espeak-ng-data/az_dict"},{"audio":0,"start":5433587,"crunched":0,"end":5466933,"filename":"/usr/share/espeak-ng-data/phonindex"},{"audio":0,"start":5466933,"crunched":0,"end":5530703,"filename":"/usr/share/espeak-ng-data/fr_dict"},{"audio":0,"start":5530703,"crunched":0,"end":5576624,"filename":"/usr/share/espeak-ng-data/tr_dict"},{"audio":0,"start":5576624,"crunched":0,"end":5624428,"filename":"/usr/share/espeak-ng-data/sw_dict"},{"audio":0,"start":5624428,"crunched":0,"end":5625744,"filename":"/usr/share/espeak-ng-data/mi_dict"},{"audio":0,"start":5625744,"crunched":0,"end":5675746,"filename":"/usr/share/espeak-ng-data/sk_dict"},{"audio":0,"start":5675746,"crunched":0,"end":5752476,"filename":"/usr/share/espeak-ng-data/pl_dict"},{"audio":0,"start":5752476,"crunched":0,"end":5901620,"filename":"/usr/share/espeak-ng-data/it_dict"},{"audio":0,"start":5901620,"crunched":0,"end":5936507,"filename":"/usr/share/espeak-ng-data/zhy_dict"},{"audio":0,"start":5936507,"crunched":0,"end":5999072,"filename":"/usr/share/espeak-ng-data/lv_dict"},{"audio":0,"start":5999072,"crunched":0,"end":6048468,"filename":"/usr/share/espeak-ng-data/hr_dict"},{"audio":0,"start":6048468,"crunched":0,"end":6098170,"filename":"/usr/share/espeak-ng-data/lt_dict"},{"audio":0,"start":6098170,"crunched":0,"end":6098531,"filename":"/usr/share/espeak-ng-data/voices/!v/kaukovalta"},{"audio":0,"start":6098531,"crunched":0,"end":6098811,"filename":"/usr/share/espeak-ng-data/voices/!v/iven2"},{"audio":0,"start":6098811,"crunched":0,"end":6099092,"filename":"/usr/share/espeak-ng-data/voices/!v/Gene"},{"audio":0,"start":6099092,"crunched":0,"end":6099382,"filename":"/usr/share/espeak-ng-data/voices/!v/m4"},{"audio":0,"start":6099382,"crunched":0,"end":6099652,"filename":"/usr/share/espeak-ng-data/voices/!v/Mario"},{"audio":0,"start":6099652,"crunched":0,"end":6099927,"filename":"/usr/share/espeak-ng-data/voices/!v/zac"},{"audio":0,"start":6099927,"crunched":0,"end":6100197,"filename":"/usr/share/espeak-ng-data/voices/!v/Michael"},{"audio":0,"start":6100197,"crunched":0,"end":6103387,"filename":"/usr/share/espeak-ng-data/voices/!v/Tweaky"},{"audio":0,"start":6103387,"crunched":0,"end":6103770,"filename":"/usr/share/espeak-ng-data/voices/!v/travis"},{"audio":0,"start":6103770,"crunched":0,"end":6106957,"filename":"/usr/share/espeak-ng-data/voices/!v/john"},{"audio":0,"start":6106957,"crunched":0,"end":6107334,"filename":"/usr/share/espeak-ng-data/voices/!v/steph3"},{"audio":0,"start":6107334,"crunched":0,"end":6107608,"filename":"/usr/share/espeak-ng-data/voices/!v/robert"},{"audio":0,"start":6107608,"crunched":0,"end":6107972,"filename":"/usr/share/espeak-ng-data/voices/!v/steph"},{"audio":0,"start":6107972,"crunched":0,"end":6108329,"filename":"/usr/share/espeak-ng-data/voices/!v/f2"},{"audio":0,"start":6108329,"crunched":0,"end":6108612,"filename":"/usr/share/espeak-ng-data/voices/!v/Gene2"},{"audio":0,"start":6108612,"crunched":0,"end":6109016,"filename":"/usr/share/espeak-ng-data/voices/!v/michel"},{"audio":0,"start":6109016,"crunched":0,"end":6109054,"filename":"/usr/share/espeak-ng-data/voices/!v/klatt"},{"audio":0,"start":6109054,"crunched":0,"end":6109279,"filename":"/usr/share/espeak-ng-data/voices/!v/max"},{"audio":0,"start":6109279,"crunched":0,"end":6109666,"filename":"/usr/share/espeak-ng-data/voices/!v/aunty"},{"audio":0,"start":6109666,"crunched":0,"end":6109990,"filename":"/usr/share/espeak-ng-data/voices/!v/f1"},{"audio":0,"start":6109990,"crunched":0,"end":6110255,"filename":"/usr/share/espeak-ng-data/voices/!v/rob"},{"audio":0,"start":6110255,"crunched":0,"end":6110441,"filename":"/usr/share/espeak-ng-data/voices/!v/whisper"},{"audio":0,"start":6110441,"crunched":0,"end":6110833,"filename":"/usr/share/espeak-ng-data/voices/!v/whisperf"},{"audio":0,"start":6110833,"crunched":0,"end":6111057,"filename":"/usr/share/espeak-ng-data/voices/!v/boris"},{"audio":0,"start":6111057,"crunched":0,"end":6114247,"filename":"/usr/share/espeak-ng-data/voices/!v/norbert"},{"audio":0,"start":6114247,"crunched":0,"end":6114612,"filename":"/usr/share/espeak-ng-data/voices/!v/Lee"},{"audio":0,"start":6114612,"crunched":0,"end":6114651,"filename":"/usr/share/espeak-ng-data/voices/!v/klatt3"},{"audio":0,"start":6114651,"crunched":0,"end":6115076,"filename":"/usr/share/espeak-ng-data/voices/!v/f5"},{"audio":0,"start":6115076,"crunched":0,"end":6115376,"filename":"/usr/share/espeak-ng-data/voices/!v/m3"},{"audio":0,"start":6115376,"crunched":0,"end":6118570,"filename":"/usr/share/espeak-ng-data/voices/!v/Mr serious"},{"audio":0,"start":6118570,"crunched":0,"end":6118885,"filename":"/usr/share/espeak-ng-data/voices/!v/Annie"},{"audio":0,"start":6118885,"crunched":0,"end":6118923,"filename":"/usr/share/espeak-ng-data/voices/!v/klatt2"},{"audio":0,"start":6118923,"crunched":0,"end":6119327,"filename":"/usr/share/espeak-ng-data/voices/!v/AnxiousAndy"},{"audio":0,"start":6119327,"crunched":0,"end":6119589,"filename":"/usr/share/espeak-ng-data/voices/!v/iven"},{"audio":0,"start":6119589,"crunched":0,"end":6119777,"filename":"/usr/share/espeak-ng-data/voices/!v/m6"},{"audio":0,"start":6119777,"crunched":0,"end":6120142,"filename":"/usr/share/espeak-ng-data/voices/!v/Andy"},{"audio":0,"start":6120142,"crunched":0,"end":6120509,"filename":"/usr/share/espeak-ng-data/voices/!v/steph2"},{"audio":0,"start":6120509,"crunched":0,"end":6120844,"filename":"/usr/share/espeak-ng-data/voices/!v/m1"},{"audio":0,"start":6120844,"crunched":0,"end":6120883,"filename":"/usr/share/espeak-ng-data/voices/!v/klatt4"},{"audio":0,"start":6120883,"crunched":0,"end":6121145,"filename":"/usr/share/espeak-ng-data/voices/!v/m5"},{"audio":0,"start":6121145,"crunched":0,"end":6121399,"filename":"/usr/share/espeak-ng-data/voices/!v/m7"},{"audio":0,"start":6121399,"crunched":0,"end":6121663,"filename":"/usr/share/espeak-ng-data/voices/!v/m2"},{"audio":0,"start":6121663,"crunched":0,"end":6121946,"filename":"/usr/share/espeak-ng-data/voices/!v/m8"},{"audio":0,"start":6121946,"crunched":0,"end":6122296,"filename":"/usr/share/espeak-ng-data/voices/!v/f4"},{"audio":0,"start":6122296,"crunched":0,"end":6122716,"filename":"/usr/share/espeak-ng-data/voices/!v/Storm"},{"audio":0,"start":6122716,"crunched":0,"end":6123091,"filename":"/usr/share/espeak-ng-data/voices/!v/f3"},{"audio":0,"start":6123091,"crunched":0,"end":6123358,"filename":"/usr/share/espeak-ng-data/voices/!v/Jacky"},{"audio":0,"start":6123358,"crunched":0,"end":6123746,"filename":"/usr/share/espeak-ng-data/voices/!v/linda"},{"audio":0,"start":6123746,"crunched":0,"end":6124100,"filename":"/usr/share/espeak-ng-data/voices/!v/quincy"},{"audio":0,"start":6124100,"crunched":0,"end":6124193,"filename":"/usr/share/espeak-ng-data/voices/!v/croak"},{"audio":0,"start":6124193,"crunched":0,"end":6124456,"filename":"/usr/share/espeak-ng-data/voices/!v/iven3"},{"audio":0,"start":6124456,"crunched":0,"end":6124761,"filename":"/usr/share/espeak-ng-data/voices/!v/Denis"},{"audio":0,"start":6124761,"crunched":0,"end":6124844,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-la1"},{"audio":0,"start":6124844,"crunched":0,"end":6124963,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-br2"},{"audio":0,"start":6124963,"crunched":0,"end":6125044,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ro1-en"},{"audio":0,"start":6125044,"crunched":0,"end":6125146,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr1-en"},{"audio":0,"start":6125146,"crunched":0,"end":6125230,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ar1"},{"audio":0,"start":6125230,"crunched":0,"end":6125329,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de3"},{"audio":0,"start":6125329,"crunched":0,"end":6125565,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de5"},{"audio":0,"start":6125565,"crunched":0,"end":6125670,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr4-en"},{"audio":0,"start":6125670,"crunched":0,"end":6125758,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ca1"},{"audio":0,"start":6125758,"crunched":0,"end":6125845,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-lt2"},{"audio":0,"start":6125845,"crunched":0,"end":6125960,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-br3"},{"audio":0,"start":6125960,"crunched":0,"end":6126110,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de7"},{"audio":0,"start":6126110,"crunched":0,"end":6126212,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-sw2"},{"audio":0,"start":6126212,"crunched":0,"end":6126309,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-hu1-en"},{"audio":0,"start":6126309,"crunched":0,"end":6126453,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de1"},{"audio":0,"start":6126453,"crunched":0,"end":6126567,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-pt1"},{"audio":0,"start":6126567,"crunched":0,"end":6126648,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de4-en"},{"audio":0,"start":6126648,"crunched":0,"end":6126731,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-af1-en"},{"audio":0,"start":6126731,"crunched":0,"end":6126827,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de1-en"},{"audio":0,"start":6126827,"crunched":0,"end":6126929,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-hu1"},{"audio":0,"start":6126929,"crunched":0,"end":6127074,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-it4"},{"audio":0,"start":6127074,"crunched":0,"end":6127148,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de6-en"},{"audio":0,"start":6127148,"crunched":0,"end":6127236,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ca2"},{"audio":0,"start":6127236,"crunched":0,"end":6127414,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-us2"},{"audio":0,"start":6127414,"crunched":0,"end":6127497,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr5"},{"audio":0,"start":6127497,"crunched":0,"end":6127580,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr7"},{"audio":0,"start":6127580,"crunched":0,"end":6127664,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ar2"},{"audio":0,"start":6127664,"crunched":0,"end":6127784,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-mx2"},{"audio":0,"start":6127784,"crunched":0,"end":6127869,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-tr1"},{"audio":0,"start":6127869,"crunched":0,"end":6127961,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-cn1"},{"audio":0,"start":6127961,"crunched":0,"end":6128043,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-cz2"},{"audio":0,"start":6128043,"crunched":0,"end":6128131,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-af1"},{"audio":0,"start":6128131,"crunched":0,"end":6128241,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr4"},{"audio":0,"start":6128241,"crunched":0,"end":6128329,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-gr2-en"},{"audio":0,"start":6128329,"crunched":0,"end":6128457,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de2"},{"audio":0,"start":6128457,"crunched":0,"end":6128544,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ro1"},{"audio":0,"start":6128544,"crunched":0,"end":6128659,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-br1"},{"audio":0,"start":6128659,"crunched":0,"end":6128808,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr1"},{"audio":0,"start":6128808,"crunched":0,"end":6128894,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ic1"},{"audio":0,"start":6128894,"crunched":0,"end":6128981,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-lt1"},{"audio":0,"start":6128981,"crunched":0,"end":6129072,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-nl2-en"},{"audio":0,"start":6129072,"crunched":0,"end":6129252,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-us3"},{"audio":0,"start":6129252,"crunched":0,"end":6129335,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr3"},{"audio":0,"start":6129335,"crunched":0,"end":6129431,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-nl2"},{"audio":0,"start":6129431,"crunched":0,"end":6129518,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-it2"},{"audio":0,"start":6129518,"crunched":0,"end":6129631,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-en1"},{"audio":0,"start":6129631,"crunched":0,"end":6129722,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-es2"},{"audio":0,"start":6129722,"crunched":0,"end":6129892,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-us1"},{"audio":0,"start":6129892,"crunched":0,"end":6129987,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ee1"},{"audio":0,"start":6129987,"crunched":0,"end":6130070,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de6-grc"},{"audio":0,"start":6130070,"crunched":0,"end":6130181,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-cr1"},{"audio":0,"start":6130181,"crunched":0,"end":6130265,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-it1"},{"audio":0,"start":6130265,"crunched":0,"end":6130358,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-sw1-en"},{"audio":0,"start":6130358,"crunched":0,"end":6130478,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-mx1"},{"audio":0,"start":6130478,"crunched":0,"end":6130577,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-sw2-en"},{"audio":0,"start":6130577,"crunched":0,"end":6130671,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-gr2"},{"audio":0,"start":6130671,"crunched":0,"end":6130815,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-vz1"},{"audio":0,"start":6130815,"crunched":0,"end":6130901,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr2"},{"audio":0,"start":6130901,"crunched":0,"end":6131e3,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-pl1"},{"audio":0,"start":6131e3,"crunched":0,"end":6131753,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ir1"},{"audio":0,"start":6131753,"crunched":0,"end":6131895,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-it3"},{"audio":0,"start":6131895,"crunched":0,"end":6131978,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr6"},{"audio":0,"start":6131978,"crunched":0,"end":6132068,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de5-en"},{"audio":0,"start":6132068,"crunched":0,"end":6132197,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de4"},{"audio":0,"start":6132197,"crunched":0,"end":6132293,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de3-en"},{"audio":0,"start":6132293,"crunched":0,"end":6132375,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-pl1-en"},{"audio":0,"start":6132375,"crunched":0,"end":6132489,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-tr2"},{"audio":0,"start":6132489,"crunched":0,"end":6132587,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-sw1"},{"audio":0,"start":6132587,"crunched":0,"end":6132688,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-id1"},{"audio":0,"start":6132688,"crunched":0,"end":6132768,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de2-en"},{"audio":0,"start":6132768,"crunched":0,"end":6132890,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de6"},{"audio":0,"start":6132890,"crunched":0,"end":6132987,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-es1"},{"audio":0,"start":6132987,"crunched":0,"end":6133106,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-br4"},{"audio":0,"start":6133106,"crunched":0,"end":6133176,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-cz1"},{"audio":0,"start":6133176,"crunched":0,"end":6133216,"filename":"/usr/share/espeak-ng-data/lang/eu"},{"audio":0,"start":6133216,"crunched":0,"end":6133267,"filename":"/usr/share/espeak-ng-data/lang/ko"},{"audio":0,"start":6133267,"crunched":0,"end":6133297,"filename":"/usr/share/espeak-ng-data/lang/esx/kl"},{"audio":0,"start":6133297,"crunched":0,"end":6133325,"filename":"/usr/share/espeak-ng-data/lang/bat/lt"},{"audio":0,"start":6133325,"crunched":0,"end":6133644,"filename":"/usr/share/espeak-ng-data/lang/bat/lv"},{"audio":0,"start":6133644,"crunched":0,"end":6133851,"filename":"/usr/share/espeak-ng-data/lang/aav/vi-VN-x-south"},{"audio":0,"start":6133851,"crunched":0,"end":6134059,"filename":"/usr/share/espeak-ng-data/lang/aav/vi-VN-x-central"},{"audio":0,"start":6134059,"crunched":0,"end":6134120,"filename":"/usr/share/espeak-ng-data/lang/aav/vi"},{"audio":0,"start":6134120,"crunched":0,"end":6134487,"filename":"/usr/share/espeak-ng-data/lang/poz/mi"},{"audio":0,"start":6134487,"crunched":0,"end":6134932,"filename":"/usr/share/espeak-ng-data/lang/poz/ms"},{"audio":0,"start":6134932,"crunched":0,"end":6135066,"filename":"/usr/share/espeak-ng-data/lang/poz/id"},{"audio":0,"start":6135066,"crunched":0,"end":6135175,"filename":"/usr/share/espeak-ng-data/lang/roa/pt"},{"audio":0,"start":6135175,"crunched":0,"end":6135200,"filename":"/usr/share/espeak-ng-data/lang/roa/ca"},{"audio":0,"start":6135200,"crunched":0,"end":6135293,"filename":"/usr/share/espeak-ng-data/lang/roa/fr"},{"audio":0,"start":6135293,"crunched":0,"end":6135433,"filename":"/usr/share/espeak-ng-data/lang/roa/ht"},{"audio":0,"start":6135433,"crunched":0,"end":6135496,"filename":"/usr/share/espeak-ng-data/lang/roa/es"},{"audio":0,"start":6135496,"crunched":0,"end":6135558,"filename":"/usr/share/espeak-ng-data/lang/roa/pap"},{"audio":0,"start":6135558,"crunched":0,"end":6135735,"filename":"/usr/share/espeak-ng-data/lang/roa/es-419"},{"audio":0,"start":6135735,"crunched":0,"end":6135762,"filename":"/usr/share/espeak-ng-data/lang/roa/an"},{"audio":0,"start":6135762,"crunched":0,"end":6135871,"filename":"/usr/share/espeak-ng-data/lang/roa/pt-BR"},{"audio":0,"start":6135871,"crunched":0,"end":6135968,"filename":"/usr/share/espeak-ng-data/lang/roa/fr-BE"},{"audio":0,"start":6135968,"crunched":0,"end":6136091,"filename":"/usr/share/espeak-ng-data/lang/roa/it"},{"audio":0,"start":6136091,"crunched":0,"end":6136117,"filename":"/usr/share/espeak-ng-data/lang/roa/ro"},{"audio":0,"start":6136117,"crunched":0,"end":6136217,"filename":"/usr/share/espeak-ng-data/lang/roa/fr-CH"},{"audio":0,"start":6136217,"crunched":0,"end":6136256,"filename":"/usr/share/espeak-ng-data/lang/cus/om"},{"audio":0,"start":6136256,"crunched":0,"end":6136303,"filename":"/usr/share/espeak-ng-data/lang/sai/gn"},{"audio":0,"start":6136303,"crunched":0,"end":6136358,"filename":"/usr/share/espeak-ng-data/lang/dra/kn"},{"audio":0,"start":6136358,"crunched":0,"end":6136415,"filename":"/usr/share/espeak-ng-data/lang/dra/ml"},{"audio":0,"start":6136415,"crunched":0,"end":6136466,"filename":"/usr/share/espeak-ng-data/lang/dra/ta"},{"audio":0,"start":6136466,"crunched":0,"end":6136536,"filename":"/usr/share/espeak-ng-data/lang/dra/te"},{"audio":0,"start":6136536,"crunched":0,"end":6136619,"filename":"/usr/share/espeak-ng-data/lang/art/jbo"},{"audio":0,"start":6136619,"crunched":0,"end":6136648,"filename":"/usr/share/espeak-ng-data/lang/art/ia"},{"audio":0,"start":6136648,"crunched":0,"end":6136689,"filename":"/usr/share/espeak-ng-data/lang/art/eo"},{"audio":0,"start":6136689,"crunched":0,"end":6136824,"filename":"/usr/share/espeak-ng-data/lang/art/lfn"},{"audio":0,"start":6136824,"crunched":0,"end":6136938,"filename":"/usr/share/espeak-ng-data/lang/azc/nci"},{"audio":0,"start":6136938,"crunched":0,"end":6136990,"filename":"/usr/share/espeak-ng-data/lang/zlw/sk"},{"audio":0,"start":6136990,"crunched":0,"end":6137042,"filename":"/usr/share/espeak-ng-data/lang/zlw/pl"},{"audio":0,"start":6137042,"crunched":0,"end":6137093,"filename":"/usr/share/espeak-ng-data/lang/zlw/cs"},{"audio":0,"start":6137093,"crunched":0,"end":6137135,"filename":"/usr/share/espeak-ng-data/lang/bnt/tn"},{"audio":0,"start":6137135,"crunched":0,"end":6137176,"filename":"/usr/share/espeak-ng-data/lang/bnt/sw"},{"audio":0,"start":6137176,"crunched":0,"end":6137204,"filename":"/usr/share/espeak-ng-data/lang/zls/mk"},{"audio":0,"start":6137204,"crunched":0,"end":6137494,"filename":"/usr/share/espeak-ng-data/lang/zls/hr"},{"audio":0,"start":6137494,"crunched":0,"end":6137537,"filename":"/usr/share/espeak-ng-data/lang/zls/sl"},{"audio":0,"start":6137537,"crunched":0,"end":6137816,"filename":"/usr/share/espeak-ng-data/lang/zls/sr"},{"audio":0,"start":6137816,"crunched":0,"end":6138074,"filename":"/usr/share/espeak-ng-data/lang/zls/bs"},{"audio":0,"start":6138074,"crunched":0,"end":6138203,"filename":"/usr/share/espeak-ng-data/lang/zls/bg"},{"audio":0,"start":6138203,"crunched":0,"end":6138295,"filename":"/usr/share/espeak-ng-data/lang/tai/shn"},{"audio":0,"start":6138295,"crunched":0,"end":6138336,"filename":"/usr/share/espeak-ng-data/lang/gmq/is"},{"audio":0,"start":6138336,"crunched":0,"end":6138393,"filename":"/usr/share/espeak-ng-data/lang/gmq/da"},{"audio":0,"start":6138393,"crunched":0,"end":6138432,"filename":"/usr/share/espeak-ng-data/lang/gmq/sv"},{"audio":0,"start":6138432,"crunched":0,"end":6138533,"filename":"/usr/share/espeak-ng-data/lang/gmq/nb"},{"audio":0,"start":6138533,"crunched":0,"end":6138598,"filename":"/usr/share/espeak-ng-data/lang/cel/cy"},{"audio":0,"start":6138598,"crunched":0,"end":6138664,"filename":"/usr/share/espeak-ng-data/lang/cel/ga"},{"audio":0,"start":6138664,"crunched":0,"end":6138715,"filename":"/usr/share/espeak-ng-data/lang/cel/gd"},{"audio":0,"start":6138715,"crunched":0,"end":6138770,"filename":"/usr/share/espeak-ng-data/lang/inc/si"},{"audio":0,"start":6138770,"crunched":0,"end":6138809,"filename":"/usr/share/espeak-ng-data/lang/inc/or"},{"audio":0,"start":6138809,"crunched":0,"end":6138903,"filename":"/usr/share/espeak-ng-data/lang/inc/ur"},{"audio":0,"start":6138903,"crunched":0,"end":6138945,"filename":"/usr/share/espeak-ng-data/lang/inc/gu"},{"audio":0,"start":6138945,"crunched":0,"end":6138987,"filename":"/usr/share/espeak-ng-data/lang/inc/as"},{"audio":0,"start":6138987,"crunched":0,"end":6139053,"filename":"/usr/share/espeak-ng-data/lang/inc/sd"},{"audio":0,"start":6139053,"crunched":0,"end":6139090,"filename":"/usr/share/espeak-ng-data/lang/inc/ne"},{"audio":0,"start":6139090,"crunched":0,"end":6139115,"filename":"/usr/share/espeak-ng-data/lang/inc/pa"},{"audio":0,"start":6139115,"crunched":0,"end":6139156,"filename":"/usr/share/espeak-ng-data/lang/inc/mr"},{"audio":0,"start":6139156,"crunched":0,"end":6139182,"filename":"/usr/share/espeak-ng-data/lang/inc/kok"},{"audio":0,"start":6139182,"crunched":0,"end":6139221,"filename":"/usr/share/espeak-ng-data/lang/inc/bpy"},{"audio":0,"start":6139221,"crunched":0,"end":6139244,"filename":"/usr/share/espeak-ng-data/lang/inc/hi"},{"audio":0,"start":6139244,"crunched":0,"end":6139269,"filename":"/usr/share/espeak-ng-data/lang/inc/bn"},{"audio":0,"start":6139269,"crunched":0,"end":6139457,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-GB-x-gbcwmd"},{"audio":0,"start":6139457,"crunched":0,"end":6139494,"filename":"/usr/share/espeak-ng-data/lang/gmw/nl"},{"audio":0,"start":6139494,"crunched":0,"end":6139634,"filename":"/usr/share/espeak-ng-data/lang/gmw/en"},{"audio":0,"start":6139634,"crunched":0,"end":6139771,"filename":"/usr/share/espeak-ng-data/lang/gmw/af"},{"audio":0,"start":6139771,"crunched":0,"end":6140046,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-US"},{"audio":0,"start":6140046,"crunched":0,"end":6140341,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-GB-scotland"},{"audio":0,"start":6140341,"crunched":0,"end":6140676,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-029"},{"audio":0,"start":6140676,"crunched":0,"end":6140914,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-GB-x-gbclan"},{"audio":0,"start":6140914,"crunched":0,"end":6140953,"filename":"/usr/share/espeak-ng-data/lang/gmw/de"},{"audio":0,"start":6140953,"crunched":0,"end":6141202,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-GB-x-rp"},{"audio":0,"start":6141202,"crunched":0,"end":6141567,"filename":"/usr/share/espeak-ng-data/lang/ine/hyw"},{"audio":0,"start":6141567,"crunched":0,"end":6141684,"filename":"/usr/share/espeak-ng-data/lang/ine/sq"},{"audio":0,"start":6141684,"crunched":0,"end":6141745,"filename":"/usr/share/espeak-ng-data/lang/ine/hy"},{"audio":0,"start":6141745,"crunched":0,"end":6141772,"filename":"/usr/share/espeak-ng-data/lang/urj/et"},{"audio":0,"start":6141772,"crunched":0,"end":6141846,"filename":"/usr/share/espeak-ng-data/lang/urj/hu"},{"audio":0,"start":6141846,"crunched":0,"end":6141885,"filename":"/usr/share/espeak-ng-data/lang/urj/fi"},{"audio":0,"start":6141885,"crunched":0,"end":6142565,"filename":"/usr/share/espeak-ng-data/lang/sit/cmn"},{"audio":0,"start":6142565,"crunched":0,"end":6142621,"filename":"/usr/share/espeak-ng-data/lang/sit/my"},{"audio":0,"start":6142621,"crunched":0,"end":6142764,"filename":"/usr/share/espeak-ng-data/lang/sit/hak"},{"audio":0,"start":6142764,"crunched":0,"end":6142973,"filename":"/usr/share/espeak-ng-data/lang/sit/yue"},{"audio":0,"start":6142973,"crunched":0,"end":6143025,"filename":"/usr/share/espeak-ng-data/lang/jpx/ja"},{"audio":0,"start":6143025,"crunched":0,"end":6143065,"filename":"/usr/share/espeak-ng-data/lang/ira/ku"},{"audio":0,"start":6143065,"crunched":0,"end":6143155,"filename":"/usr/share/espeak-ng-data/lang/ira/fa"},{"audio":0,"start":6143155,"crunched":0,"end":6143424,"filename":"/usr/share/espeak-ng-data/lang/ira/fa-Latn"},{"audio":0,"start":6143424,"crunched":0,"end":6143465,"filename":"/usr/share/espeak-ng-data/lang/sem/am"},{"audio":0,"start":6143465,"crunched":0,"end":6143506,"filename":"/usr/share/espeak-ng-data/lang/sem/mt"},{"audio":0,"start":6143506,"crunched":0,"end":6143542,"filename":"/usr/share/espeak-ng-data/lang/sem/ar"},{"audio":0,"start":6143542,"crunched":0,"end":6143565,"filename":"/usr/share/espeak-ng-data/lang/grk/el"},{"audio":0,"start":6143565,"crunched":0,"end":6143664,"filename":"/usr/share/espeak-ng-data/lang/grk/grc"},{"audio":0,"start":6143664,"crunched":0,"end":6143950,"filename":"/usr/share/espeak-ng-data/lang/itc/la"},{"audio":0,"start":6143950,"crunched":0,"end":6144230,"filename":"/usr/share/espeak-ng-data/lang/zle/ru-LV"},{"audio":0,"start":6144230,"crunched":0,"end":6144296,"filename":"/usr/share/espeak-ng-data/lang/zle/ru"},{"audio":0,"start":6144296,"crunched":0,"end":6144322,"filename":"/usr/share/espeak-ng-data/lang/ccs/ka"},{"audio":0,"start":6144322,"crunched":0,"end":6144345,"filename":"/usr/share/espeak-ng-data/lang/trk/tt"},{"audio":0,"start":6144345,"crunched":0,"end":6144388,"filename":"/usr/share/espeak-ng-data/lang/trk/ky"},{"audio":0,"start":6144388,"crunched":0,"end":6144413,"filename":"/usr/share/espeak-ng-data/lang/trk/tr"},{"audio":0,"start":6144413,"crunched":0,"end":6144458,"filename":"/usr/share/espeak-ng-data/lang/trk/az"}],"remote_package_size":6144458,"package_uuid":"4ebb9338-3f1a-480a-86e8-a4c11b120611"})}))();var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=(function(status,toThrow){throw toThrow});Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("Module['ENVIRONMENT'] value is not valid. must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER}if(ENVIRONMENT_IS_NODE){var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){var ret;if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));process["on"]("unhandledRejection",(function(reason,p){process["exit"](1)}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){Module["read"]=function shell_read(f){return read(f)}}Module["readBinary"]=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=(function(status,toThrow){quit(status)})}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};Module["setWindowTitle"]=(function(title){document.title=title})}Module["print"]=typeof console!=="undefined"?console.log.bind(console):typeof print!=="undefined"?print:null;Module["printErr"]=typeof printErr!=="undefined"?printErr:typeof console!=="undefined"&&console.warn.bind(console)||Module["print"];Module.print=Module["print"];Module.printErr=Module["printErr"];for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var STACK_ALIGN=16;function staticAlloc(size){assert(!staticSealed);var ret=STATICTOP;STATICTOP=STATICTOP+size+15&-16;return ret}function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;var ret=size=Math.ceil(size/factor)*factor;return ret}var jsCallStartIndex=1;var functionPointers=new Array(2);function addFunction(func,sig){var base=0;for(var i=base;i<base+2;i++){if(!functionPointers[i]){functionPointers[i]=func;return jsCallStartIndex+i}}throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."}function removeFunction(index){functionPointers[index-jsCallStartIndex]=null}var GLOBAL_BASE=1024;var ABORT=0;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for getValue: "+type)}return null}function getMemory(size){if(!staticSealed)return staticAlloc(size);if(!runtimeInitialized)return dynamicAlloc(size);return _malloc(size)}function Pointer_stringify(ptr,length){if(length===0||!ptr)return"";var hasUtf=0;var t;var i=0;while(1){t=HEAPU8[ptr+i>>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return UTF8ToString(ptr)}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function demangle(func){return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var WASM_PAGE_SIZE=65536;var ASMJS_PAGE_SIZE=16777216;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBuffer(buf){Module["buffer"]=buffer=buf}function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value "+TOTAL_MEMORY+", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;if(TOTAL_MEMORY<TOTAL_STACK)Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");if(Module["buffer"]){buffer=Module["buffer"]}else{if(typeof WebAssembly==="object"&&typeof WebAssembly.Memory==="function"){Module["wasmMemory"]=new WebAssembly.Memory({"initial":TOTAL_MEMORY/WASM_PAGE_SIZE,"maximum":TOTAL_MEMORY/WASM_PAGE_SIZE});buffer=Module["wasmMemory"].buffer}else{buffer=new ArrayBuffer(TOTAL_MEMORY)}Module["buffer"]=buffer}updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}HEAP32[0]=1668509029;HEAP16[1]=25459;if(HEAPU8[2]!==115||HEAPU8[3]!==99)throw"Runtime error: expected the system to be little-endian!";function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPreMain(cb){__ATMAIN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_round=Math.round;var Math_min=Math.min;var Math_max=Math.max;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}function integrateWasmJS(){var wasmTextFile="espeakng.worker.wast";var wasmBinaryFile="espeakng.worker.wasm";var asmjsCodeFile="espeakng.worker.temp.asm.js";if(typeof Module["locateFile"]==="function"){if(!isDataURI(wasmTextFile)){wasmTextFile=Module["locateFile"](wasmTextFile)}if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=Module["locateFile"](wasmBinaryFile)}if(!isDataURI(asmjsCodeFile)){asmjsCodeFile=Module["locateFile"](asmjsCodeFile)}}var wasmPageSize=64*1024;var info={"global":null,"env":null,"asm2wasm":{"f64-rem":(function(x,y){return x%y}),"debugger":(function(){debugger})},"parent":Module};var exports=null;function mergeMemory(newBuffer){var oldBuffer=Module["buffer"];if(newBuffer.byteLength<oldBuffer.byteLength){Module["printErr"]("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here")}var oldView=new Int8Array(oldBuffer);var newView=new Int8Array(newBuffer);newView.set(oldView);updateGlobalBuffer(newBuffer);updateGlobalBufferViews()}function fixImports(imports){return imports}function getBinary(){try{if(Module["wasmBinary"]){return new Uint8Array(Module["wasmBinary"])}if(Module["readBinary"]){return Module["readBinary"](wasmBinaryFile)}else{throw"on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)"}}catch(err){abort(err)}}function getBinaryPromise(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()})).catch((function(){return getBinary()}))}return new Promise((function(resolve,reject){resolve(getBinary())}))}function doNativeWasm(global,env,providedBuffer){if(typeof WebAssembly!=="object"){Module["printErr"]("no native wasm support detected");return false}if(!(Module["wasmMemory"]instanceof WebAssembly.Memory)){Module["printErr"]("no native wasm Memory in use");return false}env["memory"]=Module["wasmMemory"];info["global"]={"NaN":NaN,"Infinity":Infinity};info["global.Math"]=Math;info["env"]=env;function receiveInstance(instance,module){exports=instance.exports;if(exports.memory)mergeMemory(exports.memory);Module["asm"]=exports;Module["usingWasm"]=true;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){Module["printErr"]("Module.instantiateWasm callback failed with error: "+e);return false}}function receiveInstantiatedSource(output){receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){getBinaryPromise().then((function(binary){return WebAssembly.instantiate(binary,info)})).then(receiver).catch((function(reason){Module["printErr"]("failed to asynchronously prepare wasm: "+reason);abort(reason)}))}if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){WebAssembly.instantiateStreaming(fetch(wasmBinaryFile,{credentials:"same-origin"}),info).then(receiveInstantiatedSource).catch((function(reason){Module["printErr"]("wasm streaming compile failed: "+reason);Module["printErr"]("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)}))}else{instantiateArrayBuffer(receiveInstantiatedSource)}return{}}Module["asmPreload"]=Module["asm"];var asmjsReallocBuffer=Module["reallocBuffer"];var wasmReallocBuffer=(function(size){var PAGE_MULTIPLE=Module["usingWasm"]?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE;size=alignUp(size,PAGE_MULTIPLE);var old=Module["buffer"];var oldSize=old.byteLength;if(Module["usingWasm"]){try{var result=Module["wasmMemory"].grow((size-oldSize)/wasmPageSize);if(result!==(-1|0)){return Module["buffer"]=Module["wasmMemory"].buffer}else{return null}}catch(e){return null}}});Module["reallocBuffer"]=(function(size){if(finalMethod==="asmjs"){return asmjsReallocBuffer(size)}else{return wasmReallocBuffer(size)}});var finalMethod="";Module["asm"]=(function(global,env,providedBuffer){env=fixImports(env);if(!env["table"]){var TABLE_SIZE=Module["wasmTableSize"];if(TABLE_SIZE===undefined)TABLE_SIZE=1024;var MAX_TABLE_SIZE=Module["wasmMaxTableSize"];if(typeof WebAssembly==="object"&&typeof WebAssembly.Table==="function"){if(MAX_TABLE_SIZE!==undefined){env["table"]=new WebAssembly.Table({"initial":TABLE_SIZE,"maximum":MAX_TABLE_SIZE,"element":"anyfunc"})}else{env["table"]=new WebAssembly.Table({"initial":TABLE_SIZE,element:"anyfunc"})}}else{env["table"]=new Array(TABLE_SIZE)}Module["wasmTable"]=env["table"]}if(!env["memoryBase"]){env["memoryBase"]=Module["STATIC_BASE"]}if(!env["tableBase"]){env["tableBase"]=0}var exports;exports=doNativeWasm(global,env,providedBuffer);if(!exports)abort("no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods");return exports})}integrateWasmJS();STATIC_BASE=GLOBAL_BASE;STATICTOP=STATIC_BASE+218624;__ATINIT__.push();var STATIC_BUMP=218624;Module["STATIC_BASE"]=STATIC_BASE;Module["STATIC_BUMP"]=STATIC_BUMP;STATICTOP+=16;function _emscripten_get_now(){abort()}function _emscripten_get_now_is_monotonic(){return ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){now=_emscripten_get_now()}else{___setErrNo(ERRNO_CODES.EINVAL);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function ___clock_gettime(){return _clock_gettime.apply(null,arguments)}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var key in EXCEPTIONS.infos){var ptr=+key;var info=EXCEPTIONS.infos[ptr];if(info.adjusted===adjusted){return ptr}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___lock(){}function ___map_file(pathname,size){___setErrNo(ERRNO_CODES.EPERM);return-1}var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can   access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir}),basename:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")})};var TTY={ttys:[],init:(function(){}),shutdown:(function(){}),register:(function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)}),stream_ops:{open:(function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}stream.tty=tty;stream.seekable=false}),close:(function(stream){stream.tty.ops.flush(stream.tty)}),flush:(function(stream){stream.tty.ops.flush(stream.tty)}),read:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}for(var i=0;i<length;i++){try{stream.tty.ops.put_char(stream.tty,buffer[offset+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}}if(length){stream.node.timestamp=Date.now()}return i})},default_tty_ops:{get_char:(function(tty){if(!tty.input.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=new Buffer(BUFSIZE);var bytesRead=0;var isPosixPlatform=process.platform!="win32";var fd=process.stdin.fd;if(isPosixPlatform){var usingDevice=false;try{fd=fs.openSync("/dev/stdin","r");usingDevice=true}catch(e){}}try{bytesRead=fs.readSync(fd,buf,0,BUFSIZE,null)}catch(e){if(e.toString().indexOf("EOF")!=-1)bytesRead=0;else throw e}if(usingDevice){fs.closeSync(fd)}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i<node.usedBytes;++i)arr.push(node.contents[i]);return arr}return node.contents}),getFileDataAsTypedArray:(function(node){if(!node.contents)return new Uint8Array;if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)}),expandFileStorage:(function(node,newCapacity){if(node.contents&&node.contents.subarray&&newCapacity>node.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)|0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.length<newCapacity)node.contents.push(0)}),resizeFileStorage:(function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length<newSize)node.contents.push(0);node.usedBytes=newSize}),node_ops:{getattr:(function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}}),lookup:(function(parent,name){throw FS.genericErrors[ERRNO_CODES.ENOENT]}),mknod:(function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)}),rename:(function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}}}delete old_node.parent.contents[old_node.name];old_node.name=new_name;new_dir.contents[new_name]=old_node;old_node.parent=new_dir}),unlink:(function(parent,name){delete parent.contents[name]}),rmdir:(function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}delete parent.contents[name]}),readdir:(function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries}),symlink:(function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node}),readlink:(function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return node.link})},stream_ops:{read:(function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]}return size}),write:(function(stream,buffer,offset,length,position,canOwn){if(!length)return 0;var node=stream.node;node.timestamp=Date.now();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length}else if(node.usedBytes===0&&position===0){node.contents=new Uint8Array(buffer.subarray(offset,offset+length));node.usedBytes=length;return length}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray)node.contents.set(buffer.subarray(offset,offset+length),position);else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i]}}node.usedBytes=Math.max(node.usedBytes,position+length);return length}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.usedBytes}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position}),allocate:(function(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&(contents.buffer===buffer||contents.buffer===buffer.buffer)){allocated=false;ptr=contents.byteOffset}else{if(position>0||position+length<stream.node.usedBytes){if(contents.subarray){contents=contents.subarray(position,position+length)}else{contents=Array.prototype.slice.call(contents,position,position+length)}}allocated=true;ptr=_malloc(length);if(!ptr){throw new FS.ErrnoError(ERRNO_CODES.ENOMEM)}buffer.set(contents,ptr)}return{ptr:ptr,allocated:allocated}}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(mmapFlags&2){return 0}var bytesWritten=MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0})}};var IDBFS={dbs:{},indexedDB:(function(){if(typeof indexedDB!=="undefined")return indexedDB;var ret=null;if(typeof window==="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;assert(ret,"IDBFS used, but indexedDB not supported");return ret}),DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:(function(mount){return MEMFS.mount.apply(null,arguments)}),syncfs:(function(mount,populate,callback){IDBFS.getLocalSet(mount,(function(err,local){if(err)return callback(err);IDBFS.getRemoteSet(mount,(function(err,remote){if(err)return callback(err);var src=populate?remote:local;var dst=populate?local:remote;IDBFS.reconcile(src,dst,callback)}))}))}),getDB:(function(name,callback){var db=IDBFS.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION)}catch(e){return callback(e)}if(!req){return callback("Unable to connect to IndexedDB")}req.onupgradeneeded=(function(e){var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBFS.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBFS.DB_STORE_NAME)}if(!fileStore.indexNames.contains("timestamp")){fileStore.createIndex("timestamp","timestamp",{unique:false})}});req.onsuccess=(function(){db=req.result;IDBFS.dbs[name]=db;callback(null,db)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),getLocalSet:(function(mount,callback){var entries={};function isRealDir(p){return p!=="."&&p!==".."}function toAbsolute(root){return(function(p){return PATH.join2(root,p)})}var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat;try{stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)))}entries[path]={timestamp:stat.mtime}}return callback(null,{type:"local",entries:entries})}),getRemoteSet:(function(mount,callback){var entries={};IDBFS.getDB(mount.mountpoint,(function(err,db){if(err)return callback(err);try{var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readonly");transaction.onerror=(function(e){callback(this.error);e.preventDefault()});var store=transaction.objectStore(IDBFS.DB_STORE_NAME);var index=store.index("timestamp");index.openKeyCursor().onsuccess=(function(event){var cursor=event.target.result;if(!cursor){return callback(null,{type:"remote",db:db,entries:entries})}entries[cursor.primaryKey]={timestamp:cursor.key};cursor.continue()})}catch(e){return callback(e)}}))}),loadLocalEntry:(function(path,callback){var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){return callback(null,{timestamp:stat.mtime,mode:stat.mode})}else if(FS.isFile(stat.mode)){node.contents=MEMFS.getFileDataAsTypedArray(node);return callback(null,{timestamp:stat.mtime,mode:stat.mode,contents:node.contents})}else{return callback(new Error("node type not supported"))}}),storeLocalEntry:(function(path,entry,callback){try{if(FS.isDir(entry.mode)){FS.mkdir(path,entry.mode)}else if(FS.isFile(entry.mode)){FS.writeFile(path,entry.contents,{canOwn:true})}else{return callback(new Error("node type not supported"))}FS.chmod(path,entry.mode);FS.utime(path,entry.timestamp,entry.timestamp)}catch(e){return callback(e)}callback(null)}),removeLocalEntry:(function(path,callback){try{var lookup=FS.lookupPath(path);var stat=FS.stat(path);if(FS.isDir(stat.mode)){FS.rmdir(path)}else if(FS.isFile(stat.mode)){FS.unlink(path)}}catch(e){return callback(e)}callback(null)}),loadRemoteEntry:(function(store,path,callback){var req=store.get(path);req.onsuccess=(function(event){callback(null,event.target.result)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),storeRemoteEntry:(function(store,path,entry,callback){var req=store.put(entry,path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),removeRemoteEntry:(function(store,path,callback){var req=store.delete(path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),reconcile:(function(src,dst,callback){var total=0;var create=[];Object.keys(src.entries).forEach((function(key){var e=src.entries[key];var e2=dst.entries[key];if(!e2||e.timestamp>e2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process["binding"]("constants");if(flags["fs"]){flags=flags["fs"]}NODEFS.flagsForNodeMap={"1024":flags["O_APPEND"],"64":flags["O_CREAT"],"128":flags["O_EXCL"],"0":flags["O_RDONLY"],"2":flags["O_RDWR"],"4096":flags["O_SYNC"],"512":flags["O_TRUNC"],"1":flags["O_WRONLY"]}}),bufferFrom:(function(arrayBuffer){return Buffer.alloc?Buffer.from(arrayBuffer):new Buffer(arrayBuffer)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsForNode:(function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k}}if(!flags){return newFlags}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),write:(function(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i<parts.length-1;i++){var curr=parts.slice(0,i+1).join("/");if(!createdParents[curr]){createdParents[curr]=WORKERFS.createNode(parent,parts[i],WORKERFS.DIR_MODE,0)}parent=createdParents[curr]}return parent}function base(path){var parts=path.split("/");return parts[parts.length-1]}Array.prototype.forEach.call(mount.opts["files"]||[],(function(file){WORKERFS.createNode(ensureParent(file.name),base(file.name),WORKERFS.FILE_MODE,0,file,file.lastModifiedDate)}));(mount.opts["blobs"]||[]).forEach((function(obj){WORKERFS.createNode(ensureParent(obj["name"]),base(obj["name"]),WORKERFS.FILE_MODE,0,obj["data"])}));(mount.opts["packages"]||[]).forEach((function(pack){pack["metadata"].files.forEach((function(file){var name=file.filename.substr(1);WORKERFS.createNode(ensureParent(name),base(name),WORKERFS.FILE_MODE,0,pack["blob"].slice(file.start,file.end))}))}));return root}),createNode:(function(parent,name,mode,dev,contents,mtime){var node=FS.createNode(parent,name,mode);node.mode=mode;node.node_ops=WORKERFS.node_ops;node.stream_ops=WORKERFS.stream_ops;node.timestamp=(mtime||new Date).getTime();assert(WORKERFS.FILE_MODE!==WORKERFS.DIR_MODE);if(mode===WORKERFS.FILE_MODE){node.size=contents.size;node.contents=contents}else{node.size=4096;node.contents={}}if(parent){parent.contents[name]=node}return node}),node_ops:{getattr:(function(node){return{dev:1,ino:undefined,mode:node.mode,nlink:1,uid:0,gid:0,rdev:undefined,size:node.size,atime:new Date(node.timestamp),mtime:new Date(node.timestamp),ctime:new Date(node.timestamp),blksize:4096,blocks:Math.ceil(node.size/4096)}}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}}),lookup:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}),mknod:(function(parent,name,mode,dev){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rename:(function(oldNode,newDir,newName){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),unlink:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rmdir:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readdir:(function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries}),symlink:(function(parent,newName,oldPath){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readlink:(function(node){throw new FS.ErrnoError(ERRNO_CODES.EPERM)})},stream_ops:{read:(function(stream,buffer,offset,length,position){if(position>=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};STATICTOP+=16;STATICTOP+=16;STATICTOP+=16;var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count});current=lookup.node;if(count++>40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return{path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0}return(parentid+hash>>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else{if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdirTree:(function(path,mode){var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode)}catch(e){if(e.errno!=ERRNO_CODES.EEXIST)throw e}}}),mkdev:(function(path,mode,dev){if(typeof dev==="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)}),symlink:(function(oldpath,newpath){if(!PATH.resolve(oldpath)){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var newname=PATH.basename(newpath);var err=FS.mayCreate(parent,newname);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.symlink(parent,newname,oldpath)}),rename:(function(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;try{lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!old_dir||!new_dir)throw new FS.ErrnoError(ERRNO_CODES.ENOENT);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(ERRNO_CODES.EXDEV)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}relative=PATH.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var err=FS.mayDelete(old_dir,old_name,isdir);if(err){throw new FS.ErrnoError(err)}err=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(err){throw new FS.ErrnoError(err)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(new_dir!==old_dir){err=FS.nodePermissions(old_dir,"w");if(err){throw new FS.ErrnoError(err)}}try{if(FS.trackingDelegate["willMovePath"]){FS.trackingDelegate["willMovePath"](old_path,new_path)}}catch(e){console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}try{if(FS.trackingDelegate["onMovePath"])FS.trackingDelegate["onMovePath"](old_path,new_path)}catch(e){console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}}),rmdir:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,true);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}return node.node_ops.readdir(node)}),unlink:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,false);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.unlink(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readlink:(function(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!link.node_ops.readlink){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return PATH.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))}),stat:(function(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!node.node_ops.getattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return node.node_ops.getattr(node)}),lstat:(function(path){return FS.stat(path,true)}),chmod:(function(path,mode,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})}),lchmod:(function(path,mode){FS.chmod(path,mode,true)}),fchmod:(function(fd,mode){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chmod(stream.node,mode)}),chown:(function(path,uid,gid,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{timestamp:Date.now()})}),lchown:(function(path,uid,gid){FS.chown(path,uid,gid,true)}),fchown:(function(fd,uid,gid){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chown(stream.node,uid,gid)}),truncate:(function(path,len){if(len<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.nodePermissions(node,"w");if(err){throw new FS.ErrnoError(err)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})}),ftruncate:(function(fd,len){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}FS.truncate(stream.node,len)}),utime:(function(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})}),open:(function(path,flags,mode,fd_start,fd_end){if(path===""){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}flags=typeof flags==="string"?FS.modeStringToFlags(flags):flags;mode=typeof mode==="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path==="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(ERRNO_CODES.EEXIST)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}if(!created){var err=FS.mayOpen(node,flags);if(err){throw new FS.ErrnoError(err)}}if(flags&512){FS.truncate(node,0)}flags&=~(128|512);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false},fd_start,fd_end);if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;Module["printErr"]("read file: "+path)}}try{if(FS.trackingDelegate["onOpenFile"]){var trackingFlags=0;if((flags&2097155)!==1){trackingFlags|=FS.tracking.openFlags.READ}if((flags&2097155)!==0){trackingFlags|=FS.tracking.openFlags.WRITE}FS.trackingDelegate["onOpenFile"](path,trackingFlags)}}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: "+e.message)}return stream}),close:(function(stream){if(FS.isClosed(stream)){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}stream.fd=null}),isClosed:(function(stream){return stream.fd===null}),llseek:(function(stream,offset,whence){if(FS.isClosed(stream)){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position}),read:(function(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if(FS.isClosed(stream)){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.read){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var seeking=typeof position!=="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead}),write:(function(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if(FS.isClosed(stream)){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.write){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if(stream.flags&1024){FS.llseek(stream,0,2)}var seeking=typeof position!=="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;try{if(stream.path&&FS.trackingDelegate["onWriteToFile"])FS.trackingDelegate["onWriteToFile"](stream.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return bytesWritten}),allocate:(function(stream,offset,length){if(FS.isClosed(stream)){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(offset<0||length<=0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP)}stream.stream_ops.allocate(stream,offset,length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EACCES)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}return stream.stream_ops.mmap(stream,buffer,offset,length,position,prot,flags)}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!stream||!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)}),munmap:(function(stream){return 0}),ioctl:(function(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(ERRNO_CODES.ENOTTY)}return stream.stream_ops.ioctl(stream,cmd,arg)}),readFile:(function(path,opts){opts=opts||{};opts.flags=opts.flags||"r";opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret}),writeFile:(function(path,data,opts){opts=opts||{};opts.flags=opts.flags||"w";var stream=FS.open(path,opts.flags,opts.mode);if(typeof data==="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,undefined,opts.canOwn)}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)}),cwd:(function(){return FS.currentPath}),chdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}var err=FS.nodePermissions(lookup.node,"x");if(err){throw new FS.ErrnoError(err)}FS.currentPath=lookup.path}),createDefaultDirectories:(function(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")}),createDefaultDevices:(function(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:(function(){return 0}),write:(function(stream,buffer,offset,length,pos){return length})});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var random_device;if(typeof crypto!=="undefined"){var randomBuffer=new Uint8Array(1);random_device=(function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]})}else if(ENVIRONMENT_IS_NODE){random_device=(function(){return require("crypto")["randomBytes"](1)[0]})}else{random_device=(function(){return Math.random()*256|0})}FS.createDevice("/dev","random",random_device);FS.createDevice("/dev","urandom",random_device);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")}),createSpecialDirectories:(function(){FS.mkdir("/proc");FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:(function(){var node=FS.createNode("/proc/self","fd",16384|511,73);node.node_ops={lookup:(function(parent,name){var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:(function(){return stream.path})}};ret.parent=ret;return ret})};return node})},{},"/proc/self/fd")}),createStandardStreams:(function(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin","r");assert(stdin.fd===0,"invalid handle for stdin ("+stdin.fd+")");var stdout=FS.open("/dev/stdout","w");assert(stdout.fd===1,"invalid handle for stdout ("+stdout.fd+")");var stderr=FS.open("/dev/stderr","w");assert(stderr.fd===2,"invalid handle for stderr ("+stderr.fd+")")}),ensureErrnoError:(function(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.node=node;this.setErrno=(function(errno){this.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){this.code=key;break}}});this.setErrno(errno);this.message=ERRNO_MESSAGES[errno];if(this.stack)Object.defineProperty(this,"stack",{value:(new Error).stack,writable:true})};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[ERRNO_CODES.ENOENT].forEach((function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>"}))}),staticInit:(function(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS,"NODEFS":NODEFS,"WORKERFS":WORKERFS}}),init:(function(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()}),quit:(function(){FS.init.initialized=false;var fflush=Module["_fflush"];if(fflush)fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue}FS.close(stream)}}),getMode:(function(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode}),joinPath:(function(parts,forceRelative){var path=PATH.join.apply(null,parts);if(forceRelative&&path[0]=="/")path=path.substr(1);return path}),absolutePath:(function(relative,base){return PATH.resolve(base,relative)}),standardizePath:(function(path){return PATH.normalize(path)}),findObject:(function(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(ret.exists){return ret.object}else{___setErrNo(ret.error);return null}}),analyzePath:(function(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret}),createFolder:(function(parent,name,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.mkdir(path,mode)}),createPath:(function(parent,path,canRead,canWrite){parent=typeof parent==="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){}parent=current}return current}),createFile:(function(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode)}),createDataFile:(function(parent,name,data,canRead,canWrite,canOwn){var path=name?PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name):parent;var mode=FS.getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data==="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}FS.chmod(node,mode|146);var stream=FS.open(node,"w");FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode)}return node}),createDevice:(function(parent,name,input,output){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:(function(stream){stream.seekable=false}),close:(function(stream){if(output&&output.buffer&&output.buffer.length){output(10)}}),read:(function(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}}if(length){stream.node.timestamp=Date.now()}return i})});return FS.mkdev(path,mode,dev)}),createLink:(function(parent,name,target,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);return FS.symlink(target,path)}),forceLoadFile:(function(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;var success=true;if(typeof XMLHttpRequest!=="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")}else if(Module["read"]){try{obj.contents=intArrayFromString(Module["read"](obj.url),true);obj.usedBytes=obj.contents.length}catch(e){success=false}}else{throw new Error("Cannot load without read() or XMLHttpRequest.")}if(!success)___setErrNo(ERRNO_CODES.EIO);return success}),createLazyFile:(function(parent,name,url,canRead,canWrite){function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}LazyUint8Array.prototype.get=function LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:(function(){return this.contents.length})}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size};node.stream_ops=stream_ops;return node}),createPreloadedFile:(function(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){Browser.init();var fullname=name?PATH.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp "+fullname);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}var handled=false;Module["preloadPlugins"].forEach((function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,(function(){if(onerror)onerror();removeRunDependency(dep)}));handled=true}}));if(!handled)finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){Browser.asyncLoad(url,(function(byteArray){processData(byteArray)}),onerror)}else{processData(url)}}),indexedDB:(function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB}),DB_NAME:(function(){return"EM_FS_"+window.location.pathname}),DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=function openRequest_onupgradeneeded(){console.log("creating db");var db=openRequest.result;db.createObjectStore(FS.DB_STORE_NAME)};openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;var transaction=db.transaction([FS.DB_STORE_NAME],"readwrite");var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var putRequest=files.put(FS.analyzePath(path).object.contents,path);putRequest.onsuccess=function putRequest_onsuccess(){ok++;if(ok+fail==total)finish()};putRequest.onerror=function putRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror}),loadFilesFromDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=onerror;openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;try{var transaction=db.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){onerror(e);return}var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var getRequest=files.get(path);getRequest.onsuccess=function getRequest_onsuccess(){if(FS.analyzePath(path).exists){FS.unlink(path)}FS.createDataFile(PATH.dirname(path),PATH.basename(path),getRequest.result,true,true,true);ok++;if(ok+fail==total)finish()};getRequest.onerror=function getRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror})};var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:(function(dirfd,path){if(path[0]!=="/"){var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=FS.getStream(dirfd);if(!dirstream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);dir=dirstream.path}path=PATH.join2(dir,path)}return path}),doStat:(function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-ERRNO_CODES.ENOTDIR}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break}return ret}),doWritev:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall10(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.unlink(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall195(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall220(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),dirp=SYSCALLS.get(),count=SYSCALLS.get();if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var pos=0;while(stream.getdents.length>0&&pos+268<=count){var id;var type;var name=stream.getdents.pop();if(name[0]==="."){id=1;type=4}else{var child=FS.lookupNode(stream.node,name);id=child.id;type=FS.isChrdev(child.mode)?2:FS.isDir(child.mode)?4:FS.isLink(child.mode)?10:8}HEAP32[dirp+pos>>2]=id;HEAP32[dirp+pos+4>>2]=stream.position;HEAP16[dirp+pos+8>>1]=268;HEAP8[dirp+pos+10>>0]=type;stringToUTF8(name,dirp+pos+11,256);pos+=268}return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd};case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0};case 12:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return-1;default:{return-ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall40(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.rmdir(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21509:case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};case 21523:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21524:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function __exit(status){Module["exit"](status)}function _exit(status){__exit(status)}var _environ=STATICTOP;STATICTOP+=16;function ___buildEnvironment(env){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=staticAlloc(TOTAL_ENV_SIZE);envPtr=staticAlloc(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[_environ>>2]=envPtr}else{envPtr=HEAP32[_environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in env){if(typeof env[key]==="string"){var line=key+"="+env[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i<strings.length;i++){var line=strings[i];writeAsciiToMemory(line,poolPtr);HEAP32[envPtr+i*ptrSize>>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}var ENV={};function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}function _system(command){___setErrNo(ERRNO_CODES.EAGAIN);return-1}if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else if(typeof self==="object"&&self["performance"]&&typeof self["performance"]["now"]==="function"){_emscripten_get_now=(function(){return self["performance"]["now"]()})}else if(typeof performance==="object"&&typeof performance["now"]==="function"){_emscripten_get_now=(function(){return performance["now"]()})}else{_emscripten_get_now=Date.now}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}___buildEnvironment(ENV);DYNAMICTOP_PTR=staticAlloc(4);STACK_BASE=STACKTOP=alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["wasmTableSize"]=44;Module["wasmMaxTableSize"]=44;function jsCall_ii(index,a1){return functionPointers[index](a1)}function jsCall_iii(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_iiii(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_v(index){functionPointers[index]()}Module.asmGlobalArg={};Module.asmLibraryArg={"abort":abort,"enlargeMemory":enlargeMemory,"getTotalMemory":getTotalMemory,"abortOnCannotGrowMemory":abortOnCannotGrowMemory,"jsCall_ii":jsCall_ii,"jsCall_iii":jsCall_iii,"jsCall_iiii":jsCall_iiii,"jsCall_v":jsCall_v,"___clock_gettime":___clock_gettime,"___lock":___lock,"___map_file":___map_file,"___setErrNo":___setErrNo,"___syscall10":___syscall10,"___syscall140":___syscall140,"___syscall145":___syscall145,"___syscall146":___syscall146,"___syscall195":___syscall195,"___syscall220":___syscall220,"___syscall221":___syscall221,"___syscall40":___syscall40,"___syscall5":___syscall5,"___syscall54":___syscall54,"___syscall6":___syscall6,"___syscall91":___syscall91,"___unlock":___unlock,"_emscripten_memcpy_big":_emscripten_memcpy_big,"_exit":_exit,"_getenv":_getenv,"_system":_system,"DYNAMICTOP_PTR":DYNAMICTOP_PTR,"STACKTOP":STACKTOP};var asm=Module["asm"](Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module["asm"]=asm;var ___errno_location=Module["___errno_location"]=(function(){return Module["asm"]["___errno_location"].apply(null,arguments)});var _emscripten_bind_VoidPtr___destroy___0=Module["_emscripten_bind_VoidPtr___destroy___0"]=(function(){return Module["asm"]["_emscripten_bind_VoidPtr___destroy___0"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker___destroy___0=Module["_emscripten_bind_eSpeakNGWorker___destroy___0"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker___destroy___0"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0=Module["_emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0=Module["_emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_get_pitch_0=Module["_emscripten_bind_eSpeakNGWorker_get_pitch_0"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_get_pitch_0"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_get_rate_0=Module["_emscripten_bind_eSpeakNGWorker_get_rate_0"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_get_rate_0"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_get_samplerate_0=Module["_emscripten_bind_eSpeakNGWorker_get_samplerate_0"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_get_samplerate_0"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_get_voices_1=Module["_emscripten_bind_eSpeakNGWorker_get_voices_1"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_get_voices_1"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_pitch_1=Module["_emscripten_bind_eSpeakNGWorker_set_pitch_1"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_set_pitch_1"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_rate_1=Module["_emscripten_bind_eSpeakNGWorker_set_rate_1"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_set_rate_1"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voice_2=Module["_emscripten_bind_eSpeakNGWorker_set_voice_2"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_set_voice_2"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voice_3=Module["_emscripten_bind_eSpeakNGWorker_set_voice_3"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_set_voice_3"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voice_4=Module["_emscripten_bind_eSpeakNGWorker_set_voice_4"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_set_voice_4"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voice_5=Module["_emscripten_bind_eSpeakNGWorker_set_voice_5"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_set_voice_5"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voices_2=Module["_emscripten_bind_eSpeakNGWorker_set_voices_2"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_set_voices_2"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_synth__2=Module["_emscripten_bind_eSpeakNGWorker_synth__2"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_synth__2"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_synth_ipa__2=Module["_emscripten_bind_eSpeakNGWorker_synth_ipa__2"]=(function(){return Module["asm"]["_emscripten_bind_eSpeakNGWorker_synth_ipa__2"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT___destroy___0=Module["_emscripten_bind_espeak_EVENT___destroy___0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_EVENT___destroy___0"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_audio_position_0=Module["_emscripten_bind_espeak_EVENT_get_audio_position_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_EVENT_get_audio_position_0"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_length_0=Module["_emscripten_bind_espeak_EVENT_get_length_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_EVENT_get_length_0"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_sample_0=Module["_emscripten_bind_espeak_EVENT_get_sample_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_EVENT_get_sample_0"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_text_position_0=Module["_emscripten_bind_espeak_EVENT_get_text_position_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_EVENT_get_text_position_0"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_type_0=Module["_emscripten_bind_espeak_EVENT_get_type_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_EVENT_get_type_0"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_unique_identifier_0=Module["_emscripten_bind_espeak_EVENT_get_unique_identifier_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_EVENT_get_unique_identifier_0"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_user_data_0=Module["_emscripten_bind_espeak_EVENT_get_user_data_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_EVENT_get_user_data_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE___destroy___0=Module["_emscripten_bind_espeak_VOICE___destroy___0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE___destroy___0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_age_0=Module["_emscripten_bind_espeak_VOICE_get_age_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_age_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_gender_0=Module["_emscripten_bind_espeak_VOICE_get_gender_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_gender_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_identifier_0=Module["_emscripten_bind_espeak_VOICE_get_identifier_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_identifier_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_languages_1=Module["_emscripten_bind_espeak_VOICE_get_languages_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_languages_1"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_name_0=Module["_emscripten_bind_espeak_VOICE_get_name_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_name_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_score_0=Module["_emscripten_bind_espeak_VOICE_get_score_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_score_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_spare_0=Module["_emscripten_bind_espeak_VOICE_get_spare_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_spare_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_variant_0=Module["_emscripten_bind_espeak_VOICE_get_variant_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_variant_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_xx1_0=Module["_emscripten_bind_espeak_VOICE_get_xx1_0"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_get_xx1_0"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_age_1=Module["_emscripten_bind_espeak_VOICE_set_age_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_set_age_1"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_gender_1=Module["_emscripten_bind_espeak_VOICE_set_gender_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_set_gender_1"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_identifier_1=Module["_emscripten_bind_espeak_VOICE_set_identifier_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_set_identifier_1"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_name_1=Module["_emscripten_bind_espeak_VOICE_set_name_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_set_name_1"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_score_1=Module["_emscripten_bind_espeak_VOICE_set_score_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_set_score_1"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_spare_1=Module["_emscripten_bind_espeak_VOICE_set_spare_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_set_spare_1"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_variant_1=Module["_emscripten_bind_espeak_VOICE_set_variant_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_set_variant_1"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_xx1_1=Module["_emscripten_bind_espeak_VOICE_set_xx1_1"]=(function(){return Module["asm"]["_emscripten_bind_espeak_VOICE_set_xx1_1"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD"]=(function(){return Module["asm"]["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD"].apply(null,arguments)});var _free=Module["_free"]=(function(){return Module["asm"]["_free"].apply(null,arguments)});var _malloc=Module["_malloc"]=(function(){return Module["asm"]["_malloc"].apply(null,arguments)});var dynCall_v=Module["dynCall_v"]=(function(){return Module["asm"]["dynCall_v"].apply(null,arguments)});Module["asm"]=asm;Module["getMemory"]=getMemory;Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};function run(args){args=args||Module["arguments"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&status===0){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["exit"](status)}Module["quit"](status,new ExitStatus(status))}Module["exit"]=exit;function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}Module["noExitRuntime"]=true;run();function WrapperObject(){}WrapperObject.prototype=Object.create(WrapperObject.prototype);WrapperObject.prototype.constructor=WrapperObject;WrapperObject.prototype.__class__=WrapperObject;WrapperObject.__cache__={};Module["WrapperObject"]=WrapperObject;function getCache(__class__){return(__class__||WrapperObject).__cache__}Module["getCache"]=getCache;function wrapPointer(ptr,__class__){var cache=getCache(__class__);var ret=cache[ptr];if(ret)return ret;ret=Object.create((__class__||WrapperObject).prototype);ret.ptr=ptr;return cache[ptr]=ret}Module["wrapPointer"]=wrapPointer;function castObject(obj,__class__){return wrapPointer(obj.ptr,__class__)}Module["castObject"]=castObject;Module["NULL"]=wrapPointer(0);function destroy(obj){if(!obj["__destroy__"])throw"Error: Cannot destroy object. (Did you create it yourself?)";obj["__destroy__"]();delete getCache(obj.__class__)[obj.ptr]}Module["destroy"]=destroy;function compare(obj1,obj2){return obj1.ptr===obj2.ptr}Module["compare"]=compare;function getPointer(obj){return obj.ptr}Module["getPointer"]=getPointer;function getClass(obj){return obj.__class__}Module["getClass"]=getClass;var ensureCache={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:(function(){if(ensureCache.needed){for(var i=0;i<ensureCache.temps.length;i++){Module["_free"](ensureCache.temps[i])}ensureCache.temps.length=0;Module["_free"](ensureCache.buffer);ensureCache.buffer=0;ensureCache.size+=ensureCache.needed;ensureCache.needed=0}if(!ensureCache.buffer){ensureCache.size+=128;ensureCache.buffer=Module["_malloc"](ensureCache.size);assert(ensureCache.buffer)}ensureCache.pos=0}),alloc:(function(array,view){assert(ensureCache.buffer);var bytes=view.BYTES_PER_ELEMENT;var len=array.length*bytes;len=len+7&-8;var ret;if(ensureCache.pos+len>=ensureCache.size){assert(len>0);ensureCache.needed+=len;ret=Module["_malloc"](len);ensureCache.temps.push(ret)}else{ret=ensureCache.buffer+ensureCache.pos;ensureCache.pos+=len}return ret}),copy:(function(array,view,offset){var offsetShifted=offset;var bytes=view.BYTES_PER_ELEMENT;switch(bytes){case 2:offsetShifted>>=1;break;case 4:offsetShifted>>=2;break;case 8:offsetShifted>>=3;break}for(var i=0;i<array.length;i++){view[offsetShifted+i]=array[i]}})};function ensureString(value){if(typeof value==="string"){var intArray=intArrayFromString(value);var offset=ensureCache.alloc(intArray,HEAP8);ensureCache.copy(intArray,HEAP8,offset);return offset}return value}function eSpeakNGWorker(){this.ptr=_emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0();getCache(eSpeakNGWorker)[this.ptr]=this}eSpeakNGWorker.prototype=Object.create(WrapperObject.prototype);eSpeakNGWorker.prototype.constructor=eSpeakNGWorker;eSpeakNGWorker.prototype.__class__=eSpeakNGWorker;eSpeakNGWorker.__cache__={};Module["eSpeakNGWorker"]=eSpeakNGWorker;eSpeakNGWorker.prototype["synth_"]=eSpeakNGWorker.prototype.synth_=(function(arg0,arg1){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);if(arg1&&typeof arg1==="object")arg1=arg1.ptr;_emscripten_bind_eSpeakNGWorker_synth__2(self,arg0,arg1)});eSpeakNGWorker.prototype["synth_ipa_"]=eSpeakNGWorker.prototype.synth_ipa_=(function(arg0,arg1){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);if(arg1&&typeof arg1==="object")arg1=arg1.ptr;else arg1=ensureString(arg1);return _emscripten_bind_eSpeakNGWorker_synth_ipa__2(self,arg0,arg1)});eSpeakNGWorker.prototype["getSizeOfEventStruct_"]=eSpeakNGWorker.prototype.getSizeOfEventStruct_=(function(){var self=this.ptr;return _emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0(self)});eSpeakNGWorker.prototype["set_voice"]=eSpeakNGWorker.prototype.set_voice=(function(arg0,arg1,arg2,arg3,arg4){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);if(arg1&&typeof arg1==="object")arg1=arg1.ptr;else arg1=ensureString(arg1);if(arg2&&typeof arg2==="object")arg2=arg2.ptr;if(arg3&&typeof arg3==="object")arg3=arg3.ptr;if(arg4&&typeof arg4==="object")arg4=arg4.ptr;if(arg2===undefined){return _emscripten_bind_eSpeakNGWorker_set_voice_2(self,arg0,arg1)}if(arg3===undefined){return _emscripten_bind_eSpeakNGWorker_set_voice_3(self,arg0,arg1,arg2)}if(arg4===undefined){return _emscripten_bind_eSpeakNGWorker_set_voice_4(self,arg0,arg1,arg2,arg3)}return _emscripten_bind_eSpeakNGWorker_set_voice_5(self,arg0,arg1,arg2,arg3,arg4)});eSpeakNGWorker.prototype["get_voices"]=eSpeakNGWorker.prototype.get_voices=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;return wrapPointer(_emscripten_bind_eSpeakNGWorker_get_voices_1(self,arg0),espeak_VOICE)});eSpeakNGWorker.prototype["set_voices"]=eSpeakNGWorker.prototype.set_voices=(function(arg0,arg1){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;if(arg1&&typeof arg1==="object")arg1=arg1.ptr;_emscripten_bind_eSpeakNGWorker_set_voices_2(self,arg0,arg1)});eSpeakNGWorker.prototype["get_samplerate"]=eSpeakNGWorker.prototype.get_samplerate=(function(){var self=this.ptr;return _emscripten_bind_eSpeakNGWorker_get_samplerate_0(self)});eSpeakNGWorker.prototype["get_rate"]=eSpeakNGWorker.prototype.get_rate=(function(){var self=this.ptr;return _emscripten_bind_eSpeakNGWorker_get_rate_0(self)});eSpeakNGWorker.prototype["set_rate"]=eSpeakNGWorker.prototype.set_rate=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_eSpeakNGWorker_set_rate_1(self,arg0)});eSpeakNGWorker.prototype["get_pitch"]=eSpeakNGWorker.prototype.get_pitch=(function(){var self=this.ptr;return _emscripten_bind_eSpeakNGWorker_get_pitch_0(self)});eSpeakNGWorker.prototype["set_pitch"]=eSpeakNGWorker.prototype.set_pitch=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_eSpeakNGWorker_set_pitch_1(self,arg0)});eSpeakNGWorker.prototype["__destroy__"]=eSpeakNGWorker.prototype.__destroy__=(function(){var self=this.ptr;_emscripten_bind_eSpeakNGWorker___destroy___0(self)});function espeak_VOICE(){throw"cannot construct a espeak_VOICE, no constructor in IDL"}espeak_VOICE.prototype=Object.create(WrapperObject.prototype);espeak_VOICE.prototype.constructor=espeak_VOICE;espeak_VOICE.prototype.__class__=espeak_VOICE;espeak_VOICE.__cache__={};Module["espeak_VOICE"]=espeak_VOICE;espeak_VOICE.prototype["get_name"]=espeak_VOICE.prototype.get_name=(function(){var self=this.ptr;return Pointer_stringify(_emscripten_bind_espeak_VOICE_get_name_0(self))});espeak_VOICE.prototype["set_name"]=espeak_VOICE.prototype.set_name=(function(arg0){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);_emscripten_bind_espeak_VOICE_set_name_1(self,arg0)});espeak_VOICE.prototype["get_languages"]=espeak_VOICE.prototype.get_languages=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;return _emscripten_bind_espeak_VOICE_get_languages_1(self,arg0)});espeak_VOICE.prototype["get_identifier"]=espeak_VOICE.prototype.get_identifier=(function(){var self=this.ptr;return Pointer_stringify(_emscripten_bind_espeak_VOICE_get_identifier_0(self))});espeak_VOICE.prototype["set_identifier"]=espeak_VOICE.prototype.set_identifier=(function(arg0){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);_emscripten_bind_espeak_VOICE_set_identifier_1(self,arg0)});espeak_VOICE.prototype["get_gender"]=espeak_VOICE.prototype.get_gender=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_gender_0(self)});espeak_VOICE.prototype["set_gender"]=espeak_VOICE.prototype.set_gender=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_gender_1(self,arg0)});espeak_VOICE.prototype["get_age"]=espeak_VOICE.prototype.get_age=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_age_0(self)});espeak_VOICE.prototype["set_age"]=espeak_VOICE.prototype.set_age=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_age_1(self,arg0)});espeak_VOICE.prototype["get_variant"]=espeak_VOICE.prototype.get_variant=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_variant_0(self)});espeak_VOICE.prototype["set_variant"]=espeak_VOICE.prototype.set_variant=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_variant_1(self,arg0)});espeak_VOICE.prototype["get_xx1"]=espeak_VOICE.prototype.get_xx1=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_xx1_0(self)});espeak_VOICE.prototype["set_xx1"]=espeak_VOICE.prototype.set_xx1=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_xx1_1(self,arg0)});espeak_VOICE.prototype["get_score"]=espeak_VOICE.prototype.get_score=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_score_0(self)});espeak_VOICE.prototype["set_score"]=espeak_VOICE.prototype.set_score=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_score_1(self,arg0)});espeak_VOICE.prototype["get_spare"]=espeak_VOICE.prototype.get_spare=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_spare_0(self)});espeak_VOICE.prototype["set_spare"]=espeak_VOICE.prototype.set_spare=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_spare_1(self,arg0)});espeak_VOICE.prototype["__destroy__"]=espeak_VOICE.prototype.__destroy__=(function(){var self=this.ptr;_emscripten_bind_espeak_VOICE___destroy___0(self)});function VoidPtr(){throw"cannot construct a VoidPtr, no constructor in IDL"}VoidPtr.prototype=Object.create(WrapperObject.prototype);VoidPtr.prototype.constructor=VoidPtr;VoidPtr.prototype.__class__=VoidPtr;VoidPtr.__cache__={};Module["VoidPtr"]=VoidPtr;VoidPtr.prototype["__destroy__"]=VoidPtr.prototype.__destroy__=(function(){var self=this.ptr;_emscripten_bind_VoidPtr___destroy___0(self)});function espeak_EVENT(){throw"cannot construct a espeak_EVENT, no constructor in IDL"}espeak_EVENT.prototype=Object.create(WrapperObject.prototype);espeak_EVENT.prototype.constructor=espeak_EVENT;espeak_EVENT.prototype.__class__=espeak_EVENT;espeak_EVENT.__cache__={};Module["espeak_EVENT"]=espeak_EVENT;espeak_EVENT.prototype["get_type"]=espeak_EVENT.prototype.get_type=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_type_0(self)});espeak_EVENT.prototype["get_unique_identifier"]=espeak_EVENT.prototype.get_unique_identifier=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_unique_identifier_0(self)});espeak_EVENT.prototype["get_text_position"]=espeak_EVENT.prototype.get_text_position=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_text_position_0(self)});espeak_EVENT.prototype["get_length"]=espeak_EVENT.prototype.get_length=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_length_0(self)});espeak_EVENT.prototype["get_audio_position"]=espeak_EVENT.prototype.get_audio_position=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_audio_position_0(self)});espeak_EVENT.prototype["get_sample"]=espeak_EVENT.prototype.get_sample=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_sample_0(self)});espeak_EVENT.prototype["get_user_data"]=espeak_EVENT.prototype.get_user_data=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_user_data_0(self)});espeak_EVENT.prototype["__destroy__"]=espeak_EVENT.prototype.__destroy__=(function(){var self=this.ptr;_emscripten_bind_espeak_EVENT___destroy___0(self)});((function(){function setupEnums(){Module["espeakEVENT_LIST_TERMINATED"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED();Module["espeakEVENT_WORD"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD();Module["espeakEVENT_SENTENCE"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE();Module["espeakEVENT_MARK"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK();Module["espeakEVENT_PLAY"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY();Module["espeakEVENT_END"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END();Module["espeakEVENT_MSG_TERMINATED"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED();Module["espeakEVENT_PHONEME"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME();Module["espeakEVENT_SAMPLERATE"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE()}if(Module["calledRun"])setupEnums();else addOnPreMain(setupEnums)}))();eSpeakNGWorker.prototype.list_voices=(function(){var voices=[];var i;for(var voice=this.get_voices(i=0);voice.ptr!=0;voice=this.get_voices(++i)){var v={name:voice.get_name(),identifier:voice.get_identifier(),languages:[]};var ii=0;var byte=voice.get_languages(ii);function nullTerminatedString(offset){var str="";var index=offset;var b=voice.get_languages(index++);while(b!=0){str+=String.fromCharCode(b);b=voice.get_languages(index++)}return str}while(byte!=0){var lang={priority:byte,name:nullTerminatedString(++ii)};v.languages.push(lang);ii+=lang.name.length+1;byte=voice.get_languages(ii)}voices.push(v)}return voices});var eventTypes=["list_terminated","word","sentence","mark","play","end","msg_terminated","phoneme","samplerate"];eSpeakNGWorker.prototype.synthesize=(function(aText,aCallback){var eventStructSize=this.getSizeOfEventStruct_();function cb(ptr,length,events_pointer){var data=new Float32Array(length*2);for(var i=0;i<length;i++){data[i*2]=Math.max(-1,Math.min(1,getValue(ptr+i*2,"i16")/32768));data[i*2+1]=data[i*2]}var events=[];var ptr=events_pointer;for(ev=wrapPointer(ptr,espeak_EVENT);ev.get_type()!=Module.espeakEVENT_LIST_TERMINATED;ev=wrapPointer(ptr+=eventStructSize,espeak_EVENT)){events.push({type:eventTypes[ev.get_type()],text_position:ev.get_text_position(),word_length:ev.get_length(),audio_position:ev.get_audio_position()})}return aCallback(data,events)?1:0}var fp=addFunction(cb);this.synth_(aText,fp);removeFunction(fp)});eSpeakNGWorker.prototype.synthesize_ipa=(function(aText,aCallback){var ipaVirtualFileName="espeak-ng-ipa-tmp-"+Math.random().toString().substring(2);var res="";var code=this.synth_ipa_(aText,ipaVirtualFileName);if(code==0)res=FS.readFile(ipaVirtualFileName,{encoding:"utf8"});FS.unlink(ipaVirtualFileName);var ret={code:code,ipa:res};return ret});if(typeof WorkerGlobalScope!=="undefined"){var worker;Module.postRun.push((function(){worker=new eSpeakNGWorker;postMessage("ready")}));onmessage=(function(e){if(!worker){throw"eSpeakNGWorker worker not initialized"}var args=e.data.args;var message={callback:e.data.callback,done:true};if(e.data.method=="synthesize"){args.push((function(samples,events){postMessage({callback:e.data.callback,result:[samples.buffer,events]},[samples.buffer])}))}message.result=[worker[e.data.method].apply(worker,args)];if(e.data.callback)postMessage(message)})}
+var Module=typeof Module!=="undefined"?Module:{};var Module=typeof Module!=="undefined"?Module:{};if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0;Module.finishedDataFileDownloads=0}Module.expectedDataFileDownloads++;((function(){var loadPackage=(function(metadata){var PACKAGE_PATH;if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}else{throw"using preloaded data can only be done on a web page or in a web worker"}var PACKAGE_NAME="js/espeakng.worker.data";var REMOTE_PACKAGE_BASE="espeakng.worker.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata.remote_package_size;var PACKAGE_UUID=metadata.package_uuid;function fetchRemotePackage(packageName,packageSize,callback,errback){var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=(function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}});xhr.onerror=(function(event){throw new Error("NetworkError for: "+packageName)});xhr.onload=(function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}});xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,(function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}}),handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","usr",true,true);Module["FS_createPath"]("/usr","share",true,true);Module["FS_createPath"]("/usr/share","espeak-ng-data",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data","lang",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","zle",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","zlw",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","ine",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","gmw",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","aav",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","roa",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","gmq",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","inc",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","esx",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","azc",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","art",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","sem",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","sit",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","bnt",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","grk",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","urj",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","zls",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","poz",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","dra",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","cus",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","sai",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","trk",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","ira",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","bat",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","itc",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","ccs",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","tai",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","cel",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/lang","jpx",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data","voices",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/voices","!v",true,true);Module["FS_createPath"]("/usr/share/espeak-ng-data/voices","mb",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:(function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)}),send:(function(){}),onload:(function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)}),finish:(function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null})};var files=metadata.files;for(var i=0;i<files.length;++i){(new DataRequest(files[i].start,files[i].end,files[i].audio)).open("GET",files[i].filename)}function processPackageData(arrayBuffer){Module.finishedDataFileDownloads++;assert(arrayBuffer,"Loading data file failed.");assert(arrayBuffer instanceof ArrayBuffer,"bad input to processPackageData");var byteArray=new Uint8Array(arrayBuffer);var ptr=Module["getMemory"](byteArray.length);Module["HEAPU8"].set(byteArray,ptr);DataRequest.prototype.byteArray=Module["HEAPU8"].subarray(ptr,ptr+byteArray.length);var files=metadata.files;for(var i=0;i<files.length;++i){DataRequest.prototype.requests[files[i].filename].onload()}Module["removeRunDependency"]("datafile_js/espeakng.worker.data")}Module["addRunDependency"]("datafile_js/espeakng.worker.data");if(!Module.preloadResults)Module.preloadResults={};Module.preloadResults[PACKAGE_NAME]={fromCache:false};if(fetched){processPackageData(fetched);fetched=null}else{fetchedCallback=processPackageData}}if(Module["calledRun"]){runWithFS()}else{if(!Module["preRun"])Module["preRun"]=[];Module["preRun"].push(runWithFS)}});loadPackage({"files":[{"start":0,"audio":0,"end":62049,"filename":"/usr/share/espeak-ng-data/hy_dict"},{"start":62049,"audio":0,"end":140216,"filename":"/usr/share/espeak-ng-data/zh_dict"},{"start":140216,"audio":0,"end":186137,"filename":"/usr/share/espeak-ng-data/tr_dict"},{"start":186137,"audio":0,"end":249996,"filename":"/usr/share/espeak-ng-data/mk_dict"},{"start":249996,"audio":0,"end":339242,"filename":"/usr/share/espeak-ng-data/or_dict"},{"start":339242,"audio":0,"end":384289,"filename":"/usr/share/espeak-ng-data/sl_dict"},{"start":384289,"audio":0,"end":538074,"filename":"/usr/share/espeak-ng-data/hu_dict"},{"start":538074,"audio":0,"end":540202,"filename":"/usr/share/espeak-ng-data/pap_dict"},{"start":540202,"audio":0,"end":627593,"filename":"/usr/share/espeak-ng-data/mr_dict"},{"start":627593,"audio":0,"end":677295,"filename":"/usr/share/espeak-ng-data/lt_dict"},{"start":677295,"audio":0,"end":721649,"filename":"/usr/share/espeak-ng-data/is_dict"},{"start":721649,"audio":0,"end":725455,"filename":"/usr/share/espeak-ng-data/la_dict"},{"start":725455,"audio":0,"end":815438,"filename":"/usr/share/espeak-ng-data/bn_dict"},{"start":815438,"audio":0,"end":881422,"filename":"/usr/share/espeak-ng-data/nl_dict"},{"start":881422,"audio":0,"end":886648,"filename":"/usr/share/espeak-ng-data/bpy_dict"},{"start":886648,"audio":0,"end":940189,"filename":"/usr/share/espeak-ng-data/ms_dict"},{"start":940189,"audio":0,"end":943556,"filename":"/usr/share/espeak-ng-data/grc_dict"},{"start":943556,"audio":0,"end":945613,"filename":"/usr/share/espeak-ng-data/jbo_dict"},{"start":945613,"audio":0,"end":947421,"filename":"/usr/share/espeak-ng-data/ht_dict"},{"start":947421,"audio":0,"end":996542,"filename":"/usr/share/espeak-ng-data/gd_dict"},{"start":996542,"audio":0,"end":1042956,"filename":"/usr/share/espeak-ng-data/ja_dict"},{"start":1042956,"audio":0,"end":1109588,"filename":"/usr/share/espeak-ng-data/de_dict"},{"start":1109588,"audio":0,"end":1113972,"filename":"/usr/share/espeak-ng-data/mt_dict"},{"start":1113972,"audio":0,"end":1116274,"filename":"/usr/share/espeak-ng-data/om_dict"},{"start":1116274,"audio":0,"end":1193004,"filename":"/usr/share/espeak-ng-data/pl_dict"},{"start":1193004,"audio":0,"end":1255194,"filename":"/usr/share/espeak-ng-data/ru_dict"},{"start":1255194,"audio":0,"end":1256728,"filename":"/usr/share/espeak-ng-data/nci_dict"},{"start":1256728,"audio":0,"end":1259373,"filename":"/usr/share/espeak-ng-data/kl_dict"},{"start":1259373,"audio":0,"end":1323794,"filename":"/usr/share/espeak-ng-data/ky_dict"},{"start":1323794,"audio":0,"end":1367774,"filename":"/usr/share/espeak-ng-data/fi_dict"},{"start":1367774,"audio":0,"end":1577327,"filename":"/usr/share/espeak-ng-data/ta_dict"},{"start":1577327,"audio":0,"end":1584023,"filename":"/usr/share/espeak-ng-data/an_dict"},{"start":1584023,"audio":0,"end":1588689,"filename":"/usr/share/espeak-ng-data/eo_dict"},{"start":1588689,"audio":0,"end":1590957,"filename":"/usr/share/espeak-ng-data/ku_dict"},{"start":1590957,"audio":0,"end":1671784,"filename":"/usr/share/espeak-ng-data/ur_dict"},{"start":1671784,"audio":0,"end":1673356,"filename":"/usr/share/espeak-ng-data/shn_dict"},{"start":1673356,"audio":0,"end":1675477,"filename":"/usr/share/espeak-ng-data/tt_dict"},{"start":1675477,"audio":0,"end":1725479,"filename":"/usr/share/espeak-ng-data/sk_dict"},{"start":1725479,"audio":0,"end":1817824,"filename":"/usr/share/espeak-ng-data/ml_dict"},{"start":1817824,"audio":0,"end":1861597,"filename":"/usr/share/espeak-ng-data/az_dict"},{"start":1861597,"audio":0,"end":1929419,"filename":"/usr/share/espeak-ng-data/pt_dict"},{"start":1929419,"audio":0,"end":2095850,"filename":"/usr/share/espeak-ng-data/en_dict"},{"start":2095850,"audio":0,"end":2183339,"filename":"/usr/share/espeak-ng-data/ka_dict"},{"start":2183339,"audio":0,"end":2263300,"filename":"/usr/share/espeak-ng-data/pa_dict"},{"start":2263300,"audio":0,"end":2359248,"filename":"/usr/share/espeak-ng-data/my_dict"},{"start":2359248,"audio":0,"end":2394135,"filename":"/usr/share/espeak-ng-data/zhy_dict"},{"start":2394135,"audio":0,"end":2396928,"filename":"/usr/share/espeak-ng-data/lfn_dict"},{"start":2396928,"audio":0,"end":2399009,"filename":"/usr/share/espeak-ng-data/ia_dict"},{"start":2399009,"audio":0,"end":2402153,"filename":"/usr/share/espeak-ng-data/gn_dict"},{"start":2402153,"audio":0,"end":2551297,"filename":"/usr/share/espeak-ng-data/it_dict"},{"start":2551297,"audio":0,"end":2598133,"filename":"/usr/share/espeak-ng-data/sr_dict"},{"start":2598133,"audio":0,"end":2647517,"filename":"/usr/share/espeak-ng-data/phontab"},{"start":2647517,"audio":0,"end":2696913,"filename":"/usr/share/espeak-ng-data/hr_dict"},{"start":2696913,"audio":0,"end":2703307,"filename":"/usr/share/espeak-ng-data/kok_dict"},{"start":2703307,"audio":0,"end":2761990,"filename":"/usr/share/espeak-ng-data/sd_dict"},{"start":2761990,"audio":0,"end":2806253,"filename":"/usr/share/espeak-ng-data/et_dict"},{"start":2806253,"audio":0,"end":2894085,"filename":"/usr/share/espeak-ng-data/kn_dict"},{"start":2894085,"audio":0,"end":3422149,"filename":"/usr/share/espeak-ng-data/phondata"},{"start":3422149,"audio":0,"end":3465279,"filename":"/usr/share/espeak-ng-data/cy_dict"},{"start":3465279,"audio":0,"end":3510282,"filename":"/usr/share/espeak-ng-data/sq_dict"},{"start":3510282,"audio":0,"end":3512050,"filename":"/usr/share/espeak-ng-data/intonations"},{"start":3512050,"audio":0,"end":3564687,"filename":"/usr/share/espeak-ng-data/ga_dict"},{"start":3564687,"audio":0,"end":3660072,"filename":"/usr/share/espeak-ng-data/ne_dict"},{"start":3660072,"audio":0,"end":3707144,"filename":"/usr/share/espeak-ng-data/bs_dict"},{"start":3707144,"audio":0,"end":3770914,"filename":"/usr/share/espeak-ng-data/fr_dict"},{"start":3770914,"audio":0,"end":3834792,"filename":"/usr/share/espeak-ng-data/am_dict"},{"start":3834792,"audio":0,"end":3907567,"filename":"/usr/share/espeak-ng-data/el_dict"},{"start":3907567,"audio":0,"end":3990047,"filename":"/usr/share/espeak-ng-data/gu_dict"},{"start":3990047,"audio":0,"end":4077098,"filename":"/usr/share/espeak-ng-data/bg_dict"},{"start":4077098,"audio":0,"end":4145636,"filename":"/usr/share/espeak-ng-data/ro_dict"},{"start":4145636,"audio":0,"end":4237779,"filename":"/usr/share/espeak-ng-data/hi_dict"},{"start":4237779,"audio":0,"end":4283345,"filename":"/usr/share/espeak-ng-data/ca_dict"},{"start":4283345,"audio":0,"end":4368729,"filename":"/usr/share/espeak-ng-data/si_dict"},{"start":4368729,"audio":0,"end":4371801,"filename":"/usr/share/espeak-ng-data/tn_dict"},{"start":4371801,"audio":0,"end":4419324,"filename":"/usr/share/espeak-ng-data/ko_dict"},{"start":4419324,"audio":0,"end":4467915,"filename":"/usr/share/espeak-ng-data/eu_dict"},{"start":4467915,"audio":0,"end":4469231,"filename":"/usr/share/espeak-ng-data/mi_dict"},{"start":4469231,"audio":0,"end":4521597,"filename":"/usr/share/espeak-ng-data/vi_dict"},{"start":4521597,"audio":0,"end":4813643,"filename":"/usr/share/espeak-ng-data/fa_dict"},{"start":4813643,"audio":0,"end":4816978,"filename":"/usr/share/espeak-ng-data/hak_dict"},{"start":4816978,"audio":0,"end":4866623,"filename":"/usr/share/espeak-ng-data/cs_dict"},{"start":4866623,"audio":0,"end":4961460,"filename":"/usr/share/espeak-ng-data/te_dict"},{"start":4961460,"audio":0,"end":4966465,"filename":"/usr/share/espeak-ng-data/as_dict"},{"start":4966465,"audio":0,"end":5009923,"filename":"/usr/share/espeak-ng-data/id_dict"},{"start":5009923,"audio":0,"end":5014101,"filename":"/usr/share/espeak-ng-data/no_dict"},{"start":5014101,"audio":0,"end":5076666,"filename":"/usr/share/espeak-ng-data/lv_dict"},{"start":5076666,"audio":0,"end":5198144,"filename":"/usr/share/espeak-ng-data/af_dict"},{"start":5198144,"audio":0,"end":5245948,"filename":"/usr/share/espeak-ng-data/sw_dict"},{"start":5245948,"audio":0,"end":5491243,"filename":"/usr/share/espeak-ng-data/da_dict"},{"start":5491243,"audio":0,"end":5539079,"filename":"/usr/share/espeak-ng-data/sv_dict"},{"start":5539079,"audio":0,"end":5587844,"filename":"/usr/share/espeak-ng-data/es_dict"},{"start":5587844,"audio":0,"end":5621190,"filename":"/usr/share/espeak-ng-data/phonindex"},{"start":5621190,"audio":0,"end":6098170,"filename":"/usr/share/espeak-ng-data/ar_dict"},{"start":6098170,"audio":0,"end":6098221,"filename":"/usr/share/espeak-ng-data/lang/ko"},{"start":6098221,"audio":0,"end":6098261,"filename":"/usr/share/espeak-ng-data/lang/eu"},{"start":6098261,"audio":0,"end":6098327,"filename":"/usr/share/espeak-ng-data/lang/zle/ru"},{"start":6098327,"audio":0,"end":6098607,"filename":"/usr/share/espeak-ng-data/lang/zle/ru-LV"},{"start":6098607,"audio":0,"end":6098659,"filename":"/usr/share/espeak-ng-data/lang/zlw/sk"},{"start":6098659,"audio":0,"end":6098711,"filename":"/usr/share/espeak-ng-data/lang/zlw/pl"},{"start":6098711,"audio":0,"end":6098762,"filename":"/usr/share/espeak-ng-data/lang/zlw/cs"},{"start":6098762,"audio":0,"end":6098879,"filename":"/usr/share/espeak-ng-data/lang/ine/sq"},{"start":6098879,"audio":0,"end":6098940,"filename":"/usr/share/espeak-ng-data/lang/ine/hy"},{"start":6098940,"audio":0,"end":6099305,"filename":"/usr/share/espeak-ng-data/lang/ine/hyw"},{"start":6099305,"audio":0,"end":6099640,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-029"},{"start":6099640,"audio":0,"end":6099935,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-GB-scotland"},{"start":6099935,"audio":0,"end":6099972,"filename":"/usr/share/espeak-ng-data/lang/gmw/nl"},{"start":6099972,"audio":0,"end":6100109,"filename":"/usr/share/espeak-ng-data/lang/gmw/af"},{"start":6100109,"audio":0,"end":6100148,"filename":"/usr/share/espeak-ng-data/lang/gmw/de"},{"start":6100148,"audio":0,"end":6100336,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-GB-x-gbcwmd"},{"start":6100336,"audio":0,"end":6100585,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-GB-x-rp"},{"start":6100585,"audio":0,"end":6100823,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-GB-x-gbclan"},{"start":6100823,"audio":0,"end":6100963,"filename":"/usr/share/espeak-ng-data/lang/gmw/en"},{"start":6100963,"audio":0,"end":6101238,"filename":"/usr/share/espeak-ng-data/lang/gmw/en-US"},{"start":6101238,"audio":0,"end":6101299,"filename":"/usr/share/espeak-ng-data/lang/aav/vi"},{"start":6101299,"audio":0,"end":6101506,"filename":"/usr/share/espeak-ng-data/lang/aav/vi-VN-x-south"},{"start":6101506,"audio":0,"end":6101714,"filename":"/usr/share/espeak-ng-data/lang/aav/vi-VN-x-central"},{"start":6101714,"audio":0,"end":6101837,"filename":"/usr/share/espeak-ng-data/lang/roa/it"},{"start":6101837,"audio":0,"end":6101862,"filename":"/usr/share/espeak-ng-data/lang/roa/ca"},{"start":6101862,"audio":0,"end":6101924,"filename":"/usr/share/espeak-ng-data/lang/roa/pap"},{"start":6101924,"audio":0,"end":6101950,"filename":"/usr/share/espeak-ng-data/lang/roa/ro"},{"start":6101950,"audio":0,"end":6102059,"filename":"/usr/share/espeak-ng-data/lang/roa/pt"},{"start":6102059,"audio":0,"end":6102159,"filename":"/usr/share/espeak-ng-data/lang/roa/fr-CH"},{"start":6102159,"audio":0,"end":6102299,"filename":"/usr/share/espeak-ng-data/lang/roa/ht"},{"start":6102299,"audio":0,"end":6102326,"filename":"/usr/share/espeak-ng-data/lang/roa/an"},{"start":6102326,"audio":0,"end":6102435,"filename":"/usr/share/espeak-ng-data/lang/roa/pt-BR"},{"start":6102435,"audio":0,"end":6102612,"filename":"/usr/share/espeak-ng-data/lang/roa/es-419"},{"start":6102612,"audio":0,"end":6102705,"filename":"/usr/share/espeak-ng-data/lang/roa/fr"},{"start":6102705,"audio":0,"end":6102768,"filename":"/usr/share/espeak-ng-data/lang/roa/es"},{"start":6102768,"audio":0,"end":6102865,"filename":"/usr/share/espeak-ng-data/lang/roa/fr-BE"},{"start":6102865,"audio":0,"end":6102904,"filename":"/usr/share/espeak-ng-data/lang/gmq/sv"},{"start":6102904,"audio":0,"end":6102961,"filename":"/usr/share/espeak-ng-data/lang/gmq/da"},{"start":6102961,"audio":0,"end":6103002,"filename":"/usr/share/espeak-ng-data/lang/gmq/is"},{"start":6103002,"audio":0,"end":6103103,"filename":"/usr/share/espeak-ng-data/lang/gmq/nb"},{"start":6103103,"audio":0,"end":6103197,"filename":"/usr/share/espeak-ng-data/lang/inc/ur"},{"start":6103197,"audio":0,"end":6103263,"filename":"/usr/share/espeak-ng-data/lang/inc/sd"},{"start":6103263,"audio":0,"end":6103304,"filename":"/usr/share/espeak-ng-data/lang/inc/mr"},{"start":6103304,"audio":0,"end":6103346,"filename":"/usr/share/espeak-ng-data/lang/inc/gu"},{"start":6103346,"audio":0,"end":6103385,"filename":"/usr/share/espeak-ng-data/lang/inc/bpy"},{"start":6103385,"audio":0,"end":6103411,"filename":"/usr/share/espeak-ng-data/lang/inc/kok"},{"start":6103411,"audio":0,"end":6103436,"filename":"/usr/share/espeak-ng-data/lang/inc/pa"},{"start":6103436,"audio":0,"end":6103491,"filename":"/usr/share/espeak-ng-data/lang/inc/si"},{"start":6103491,"audio":0,"end":6103516,"filename":"/usr/share/espeak-ng-data/lang/inc/bn"},{"start":6103516,"audio":0,"end":6103553,"filename":"/usr/share/espeak-ng-data/lang/inc/ne"},{"start":6103553,"audio":0,"end":6103576,"filename":"/usr/share/espeak-ng-data/lang/inc/hi"},{"start":6103576,"audio":0,"end":6103618,"filename":"/usr/share/espeak-ng-data/lang/inc/as"},{"start":6103618,"audio":0,"end":6103657,"filename":"/usr/share/espeak-ng-data/lang/inc/or"},{"start":6103657,"audio":0,"end":6103687,"filename":"/usr/share/espeak-ng-data/lang/esx/kl"},{"start":6103687,"audio":0,"end":6103801,"filename":"/usr/share/espeak-ng-data/lang/azc/nci"},{"start":6103801,"audio":0,"end":6103884,"filename":"/usr/share/espeak-ng-data/lang/art/jbo"},{"start":6103884,"audio":0,"end":6103913,"filename":"/usr/share/espeak-ng-data/lang/art/ia"},{"start":6103913,"audio":0,"end":6104048,"filename":"/usr/share/espeak-ng-data/lang/art/lfn"},{"start":6104048,"audio":0,"end":6104089,"filename":"/usr/share/espeak-ng-data/lang/art/eo"},{"start":6104089,"audio":0,"end":6104130,"filename":"/usr/share/espeak-ng-data/lang/sem/mt"},{"start":6104130,"audio":0,"end":6104171,"filename":"/usr/share/espeak-ng-data/lang/sem/am"},{"start":6104171,"audio":0,"end":6104207,"filename":"/usr/share/espeak-ng-data/lang/sem/ar"},{"start":6104207,"audio":0,"end":6104350,"filename":"/usr/share/espeak-ng-data/lang/sit/hak"},{"start":6104350,"audio":0,"end":6105030,"filename":"/usr/share/espeak-ng-data/lang/sit/cmn"},{"start":6105030,"audio":0,"end":6105239,"filename":"/usr/share/espeak-ng-data/lang/sit/yue"},{"start":6105239,"audio":0,"end":6105295,"filename":"/usr/share/espeak-ng-data/lang/sit/my"},{"start":6105295,"audio":0,"end":6105336,"filename":"/usr/share/espeak-ng-data/lang/bnt/sw"},{"start":6105336,"audio":0,"end":6105378,"filename":"/usr/share/espeak-ng-data/lang/bnt/tn"},{"start":6105378,"audio":0,"end":6105477,"filename":"/usr/share/espeak-ng-data/lang/grk/grc"},{"start":6105477,"audio":0,"end":6105500,"filename":"/usr/share/espeak-ng-data/lang/grk/el"},{"start":6105500,"audio":0,"end":6105574,"filename":"/usr/share/espeak-ng-data/lang/urj/hu"},{"start":6105574,"audio":0,"end":6105613,"filename":"/usr/share/espeak-ng-data/lang/urj/fi"},{"start":6105613,"audio":0,"end":6105640,"filename":"/usr/share/espeak-ng-data/lang/urj/et"},{"start":6105640,"audio":0,"end":6105683,"filename":"/usr/share/espeak-ng-data/lang/zls/sl"},{"start":6105683,"audio":0,"end":6105962,"filename":"/usr/share/espeak-ng-data/lang/zls/sr"},{"start":6105962,"audio":0,"end":6105990,"filename":"/usr/share/espeak-ng-data/lang/zls/mk"},{"start":6105990,"audio":0,"end":6106248,"filename":"/usr/share/espeak-ng-data/lang/zls/bs"},{"start":6106248,"audio":0,"end":6106538,"filename":"/usr/share/espeak-ng-data/lang/zls/hr"},{"start":6106538,"audio":0,"end":6106667,"filename":"/usr/share/espeak-ng-data/lang/zls/bg"},{"start":6106667,"audio":0,"end":6107112,"filename":"/usr/share/espeak-ng-data/lang/poz/ms"},{"start":6107112,"audio":0,"end":6107479,"filename":"/usr/share/espeak-ng-data/lang/poz/mi"},{"start":6107479,"audio":0,"end":6107613,"filename":"/usr/share/espeak-ng-data/lang/poz/id"},{"start":6107613,"audio":0,"end":6107683,"filename":"/usr/share/espeak-ng-data/lang/dra/te"},{"start":6107683,"audio":0,"end":6107740,"filename":"/usr/share/espeak-ng-data/lang/dra/ml"},{"start":6107740,"audio":0,"end":6107795,"filename":"/usr/share/espeak-ng-data/lang/dra/kn"},{"start":6107795,"audio":0,"end":6107846,"filename":"/usr/share/espeak-ng-data/lang/dra/ta"},{"start":6107846,"audio":0,"end":6107885,"filename":"/usr/share/espeak-ng-data/lang/cus/om"},{"start":6107885,"audio":0,"end":6107932,"filename":"/usr/share/espeak-ng-data/lang/sai/gn"},{"start":6107932,"audio":0,"end":6107975,"filename":"/usr/share/espeak-ng-data/lang/trk/ky"},{"start":6107975,"audio":0,"end":6108020,"filename":"/usr/share/espeak-ng-data/lang/trk/az"},{"start":6108020,"audio":0,"end":6108043,"filename":"/usr/share/espeak-ng-data/lang/trk/tt"},{"start":6108043,"audio":0,"end":6108068,"filename":"/usr/share/espeak-ng-data/lang/trk/tr"},{"start":6108068,"audio":0,"end":6108337,"filename":"/usr/share/espeak-ng-data/lang/ira/fa-Latn"},{"start":6108337,"audio":0,"end":6108377,"filename":"/usr/share/espeak-ng-data/lang/ira/ku"},{"start":6108377,"audio":0,"end":6108467,"filename":"/usr/share/espeak-ng-data/lang/ira/fa"},{"start":6108467,"audio":0,"end":6108786,"filename":"/usr/share/espeak-ng-data/lang/bat/lv"},{"start":6108786,"audio":0,"end":6108814,"filename":"/usr/share/espeak-ng-data/lang/bat/lt"},{"start":6108814,"audio":0,"end":6109100,"filename":"/usr/share/espeak-ng-data/lang/itc/la"},{"start":6109100,"audio":0,"end":6109126,"filename":"/usr/share/espeak-ng-data/lang/ccs/ka"},{"start":6109126,"audio":0,"end":6109218,"filename":"/usr/share/espeak-ng-data/lang/tai/shn"},{"start":6109218,"audio":0,"end":6109284,"filename":"/usr/share/espeak-ng-data/lang/cel/ga"},{"start":6109284,"audio":0,"end":6109335,"filename":"/usr/share/espeak-ng-data/lang/cel/gd"},{"start":6109335,"audio":0,"end":6109400,"filename":"/usr/share/espeak-ng-data/lang/cel/cy"},{"start":6109400,"audio":0,"end":6109452,"filename":"/usr/share/espeak-ng-data/lang/jpx/ja"},{"start":6109452,"audio":0,"end":6112642,"filename":"/usr/share/espeak-ng-data/voices/!v/norbert"},{"start":6112642,"audio":0,"end":6113030,"filename":"/usr/share/espeak-ng-data/voices/!v/linda"},{"start":6113030,"audio":0,"end":6113068,"filename":"/usr/share/espeak-ng-data/voices/!v/klatt"},{"start":6113068,"audio":0,"end":6113351,"filename":"/usr/share/espeak-ng-data/voices/!v/m8"},{"start":6113351,"audio":0,"end":6113686,"filename":"/usr/share/espeak-ng-data/voices/!v/m1"},{"start":6113686,"audio":0,"end":6113874,"filename":"/usr/share/espeak-ng-data/voices/!v/m6"},{"start":6113874,"audio":0,"end":6114239,"filename":"/usr/share/espeak-ng-data/voices/!v/Lee"},{"start":6114239,"audio":0,"end":6114493,"filename":"/usr/share/espeak-ng-data/voices/!v/m7"},{"start":6114493,"audio":0,"end":6114776,"filename":"/usr/share/espeak-ng-data/voices/!v/Gene2"},{"start":6114776,"audio":0,"end":6115081,"filename":"/usr/share/espeak-ng-data/voices/!v/Denis"},{"start":6115081,"audio":0,"end":6115435,"filename":"/usr/share/espeak-ng-data/voices/!v/quincy"},{"start":6115435,"audio":0,"end":6115785,"filename":"/usr/share/espeak-ng-data/voices/!v/f4"},{"start":6115785,"audio":0,"end":6116160,"filename":"/usr/share/espeak-ng-data/voices/!v/f3"},{"start":6116160,"audio":0,"end":6116527,"filename":"/usr/share/espeak-ng-data/voices/!v/steph2"},{"start":6116527,"audio":0,"end":6119717,"filename":"/usr/share/espeak-ng-data/voices/!v/Tweaky"},{"start":6119717,"audio":0,"end":6120121,"filename":"/usr/share/espeak-ng-data/voices/!v/AnxiousAndy"},{"start":6120121,"audio":0,"end":6120478,"filename":"/usr/share/espeak-ng-data/voices/!v/f2"},{"start":6120478,"audio":0,"end":6120855,"filename":"/usr/share/espeak-ng-data/voices/!v/steph3"},{"start":6120855,"audio":0,"end":6121280,"filename":"/usr/share/espeak-ng-data/voices/!v/f5"},{"start":6121280,"audio":0,"end":6121550,"filename":"/usr/share/espeak-ng-data/voices/!v/Michael"},{"start":6121550,"audio":0,"end":6121824,"filename":"/usr/share/espeak-ng-data/voices/!v/robert"},{"start":6121824,"audio":0,"end":6122048,"filename":"/usr/share/espeak-ng-data/voices/!v/boris"},{"start":6122048,"audio":0,"end":6122452,"filename":"/usr/share/espeak-ng-data/voices/!v/michel"},{"start":6122452,"audio":0,"end":6122727,"filename":"/usr/share/espeak-ng-data/voices/!v/zac"},{"start":6122727,"audio":0,"end":6123092,"filename":"/usr/share/espeak-ng-data/voices/!v/Andy"},{"start":6123092,"audio":0,"end":6123373,"filename":"/usr/share/espeak-ng-data/voices/!v/Gene"},{"start":6123373,"audio":0,"end":6123598,"filename":"/usr/share/espeak-ng-data/voices/!v/max"},{"start":6123598,"audio":0,"end":6123861,"filename":"/usr/share/espeak-ng-data/voices/!v/iven3"},{"start":6123861,"audio":0,"end":6124225,"filename":"/usr/share/espeak-ng-data/voices/!v/steph"},{"start":6124225,"audio":0,"end":6124505,"filename":"/usr/share/espeak-ng-data/voices/!v/iven2"},{"start":6124505,"audio":0,"end":6124770,"filename":"/usr/share/espeak-ng-data/voices/!v/rob"},{"start":6124770,"audio":0,"end":6125032,"filename":"/usr/share/espeak-ng-data/voices/!v/iven"},{"start":6125032,"audio":0,"end":6125419,"filename":"/usr/share/espeak-ng-data/voices/!v/aunty"},{"start":6125419,"audio":0,"end":6125681,"filename":"/usr/share/espeak-ng-data/voices/!v/m5"},{"start":6125681,"audio":0,"end":6125945,"filename":"/usr/share/espeak-ng-data/voices/!v/m2"},{"start":6125945,"audio":0,"end":6126245,"filename":"/usr/share/espeak-ng-data/voices/!v/m3"},{"start":6126245,"audio":0,"end":6126535,"filename":"/usr/share/espeak-ng-data/voices/!v/m4"},{"start":6126535,"audio":0,"end":6129722,"filename":"/usr/share/espeak-ng-data/voices/!v/john"},{"start":6129722,"audio":0,"end":6129760,"filename":"/usr/share/espeak-ng-data/voices/!v/klatt2"},{"start":6129760,"audio":0,"end":6130152,"filename":"/usr/share/espeak-ng-data/voices/!v/whisperf"},{"start":6130152,"audio":0,"end":6130245,"filename":"/usr/share/espeak-ng-data/voices/!v/croak"},{"start":6130245,"audio":0,"end":6130569,"filename":"/usr/share/espeak-ng-data/voices/!v/f1"},{"start":6130569,"audio":0,"end":6133763,"filename":"/usr/share/espeak-ng-data/voices/!v/Mr serious"},{"start":6133763,"audio":0,"end":6134124,"filename":"/usr/share/espeak-ng-data/voices/!v/kaukovalta"},{"start":6134124,"audio":0,"end":6134163,"filename":"/usr/share/espeak-ng-data/voices/!v/klatt4"},{"start":6134163,"audio":0,"end":6134433,"filename":"/usr/share/espeak-ng-data/voices/!v/Mario"},{"start":6134433,"audio":0,"end":6134472,"filename":"/usr/share/espeak-ng-data/voices/!v/klatt3"},{"start":6134472,"audio":0,"end":6134892,"filename":"/usr/share/espeak-ng-data/voices/!v/Storm"},{"start":6134892,"audio":0,"end":6135207,"filename":"/usr/share/espeak-ng-data/voices/!v/Annie"},{"start":6135207,"audio":0,"end":6135590,"filename":"/usr/share/espeak-ng-data/voices/!v/travis"},{"start":6135590,"audio":0,"end":6135857,"filename":"/usr/share/espeak-ng-data/voices/!v/Jacky"},{"start":6135857,"audio":0,"end":6136043,"filename":"/usr/share/espeak-ng-data/voices/!v/whisper"},{"start":6136043,"audio":0,"end":6136157,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-pt1"},{"start":6136157,"audio":0,"end":6136253,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-nl2"},{"start":6136253,"audio":0,"end":6136367,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-tr2"},{"start":6136367,"audio":0,"end":6136469,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr1-en"},{"start":6136469,"audio":0,"end":6136598,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de4"},{"start":6136598,"audio":0,"end":6136697,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de3"},{"start":6136697,"audio":0,"end":6136793,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de3-en"},{"start":6136793,"audio":0,"end":6136875,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-cz2"},{"start":6136875,"audio":0,"end":6137003,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de2"},{"start":6137003,"audio":0,"end":6137100,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-es1"},{"start":6137100,"audio":0,"end":6137336,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de5"},{"start":6137336,"audio":0,"end":6137451,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-br3"},{"start":6137451,"audio":0,"end":6137556,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr4-en"},{"start":6137556,"audio":0,"end":6137736,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-us3"},{"start":6137736,"audio":0,"end":6137855,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-br4"},{"start":6137855,"audio":0,"end":6137935,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de2-en"},{"start":6137935,"audio":0,"end":6138018,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr5"},{"start":6138018,"audio":0,"end":6138104,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr2"},{"start":6138104,"audio":0,"end":6138282,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-us2"},{"start":6138282,"audio":0,"end":6138381,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-pl1"},{"start":6138381,"audio":0,"end":6138500,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-br2"},{"start":6138500,"audio":0,"end":6138587,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-lt1"},{"start":6138587,"audio":0,"end":6138688,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-id1"},{"start":6138688,"audio":0,"end":6138771,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr3"},{"start":6138771,"audio":0,"end":6138881,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr4"},{"start":6138881,"audio":0,"end":6138974,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-sw1-en"},{"start":6138974,"audio":0,"end":6139056,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-pl1-en"},{"start":6139056,"audio":0,"end":6139130,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de6-en"},{"start":6139130,"audio":0,"end":6139222,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-cn1"},{"start":6139222,"audio":0,"end":6139310,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ca2"},{"start":6139310,"audio":0,"end":6139405,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ee1"},{"start":6139405,"audio":0,"end":6139491,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ic1"},{"start":6139491,"audio":0,"end":6139589,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-sw1"},{"start":6139589,"audio":0,"end":6139677,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-af1"},{"start":6139677,"audio":0,"end":6139764,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-it2"},{"start":6139764,"audio":0,"end":6139884,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-mx1"},{"start":6139884,"audio":0,"end":6139967,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-la1"},{"start":6139967,"audio":0,"end":6140112,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-it4"},{"start":6140112,"audio":0,"end":6140254,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-it3"},{"start":6140254,"audio":0,"end":6140337,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-af1-en"},{"start":6140337,"audio":0,"end":6140420,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de6-grc"},{"start":6140420,"audio":0,"end":6141173,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ir1"},{"start":6141173,"audio":0,"end":6141257,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ar2"},{"start":6141257,"audio":0,"end":6141368,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-cr1"},{"start":6141368,"audio":0,"end":6141518,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de7"},{"start":6141518,"audio":0,"end":6141603,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-tr1"},{"start":6141603,"audio":0,"end":6141673,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-cz1"},{"start":6141673,"audio":0,"end":6141795,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de6"},{"start":6141795,"audio":0,"end":6141939,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de1"},{"start":6141939,"audio":0,"end":6142030,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-es2"},{"start":6142030,"audio":0,"end":6142179,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr1"},{"start":6142179,"audio":0,"end":6142262,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr6"},{"start":6142262,"audio":0,"end":6142353,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-nl2-en"},{"start":6142353,"audio":0,"end":6142440,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ro1"},{"start":6142440,"audio":0,"end":6142553,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-en1"},{"start":6142553,"audio":0,"end":6142636,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-fr7"},{"start":6142636,"audio":0,"end":6142724,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ca1"},{"start":6142724,"audio":0,"end":6142839,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-br1"},{"start":6142839,"audio":0,"end":6143009,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-us1"},{"start":6143009,"audio":0,"end":6143096,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-lt2"},{"start":6143096,"audio":0,"end":6143192,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de1-en"},{"start":6143192,"audio":0,"end":6143294,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-sw2"},{"start":6143294,"audio":0,"end":6143382,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-gr2-en"},{"start":6143382,"audio":0,"end":6143484,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-hu1"},{"start":6143484,"audio":0,"end":6143583,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-sw2-en"},{"start":6143583,"audio":0,"end":6143673,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de5-en"},{"start":6143673,"audio":0,"end":6143793,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-mx2"},{"start":6143793,"audio":0,"end":6143874,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ro1-en"},{"start":6143874,"audio":0,"end":6143968,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-gr2"},{"start":6143968,"audio":0,"end":6144049,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-de4-en"},{"start":6144049,"audio":0,"end":6144193,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-vz1"},{"start":6144193,"audio":0,"end":6144277,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-it1"},{"start":6144277,"audio":0,"end":6144361,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-ar1"},{"start":6144361,"audio":0,"end":6144458,"filename":"/usr/share/espeak-ng-data/voices/mb/mb-hu1-en"}],"remote_package_size":6144458,"package_uuid":"69f6b97e-e505-4bfc-8703-cccc8a34e4a2"})}))();var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=(function(status,toThrow){throw toThrow});Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}else{return scriptDirectory+path}}if(ENVIRONMENT_IS_NODE){scriptDirectory=__dirname+"/";var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){var ret;if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));process["on"]("unhandledRejection",abort);Module["quit"]=(function(status){process["exit"](status)});Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){Module["read"]=function shell_read(f){return read(f)}}Module["readBinary"]=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=(function(status){quit(status)})}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}Module["read"]=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};Module["setWindowTitle"]=(function(title){document.title=title})}else{}var out=Module["print"]||(typeof console!=="undefined"?console.log.bind(console):typeof print!=="undefined"?print:null);var err=Module["printErr"]||(typeof printErr!=="undefined"?printErr:typeof console!=="undefined"&&console.warn.bind(console)||out);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;function dynamicAlloc(size){var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}var asm2wasmImports={"f64-rem":(function(x,y){return x%y}),"debugger":(function(){debugger})};var jsCallStartIndex=1;var functionPointers=new Array(2);function addFunction(func,sig){var base=0;for(var i=base;i<base+2;i++){if(!functionPointers[i]){functionPointers[i]=func;return jsCallStartIndex+i}}throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."}function removeFunction(index){functionPointers[index-jsCallStartIndex]=null}var GLOBAL_BASE=1024;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for getValue: "+type)}return null}function getMemory(size){if(!runtimeInitialized)return dynamicAlloc(size);return _malloc(size)}function Pointer_stringify(ptr,length){if(length===0||!ptr)return"";var hasUtf=0;var t;var i=0;while(1){t=HEAPU8[ptr+i>>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return UTF8ToString(ptr)}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function demangle(func){return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBuffer(buf){Module["buffer"]=buffer=buf}function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE=1024,DYNAMIC_BASE=5725648,DYNAMICTOP_PTR=482512;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value "+TOTAL_MEMORY+", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;if(TOTAL_MEMORY<TOTAL_STACK)err("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");if(Module["buffer"]){buffer=Module["buffer"]}else{if(typeof WebAssembly==="object"&&typeof WebAssembly.Memory==="function"){Module["wasmMemory"]=new WebAssembly.Memory({"initial":TOTAL_MEMORY/WASM_PAGE_SIZE,"maximum":TOTAL_MEMORY/WASM_PAGE_SIZE});buffer=Module["wasmMemory"].buffer}else{buffer=new ArrayBuffer(TOTAL_MEMORY)}Module["buffer"]=buffer}updateGlobalBufferViews();HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;function getTotalMemory(){return TOTAL_MEMORY}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPreMain(cb){__ATMAIN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var Math_cos=Math.cos;var Math_sin=Math.sin;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}function integrateWasmJS(){var wasmBinaryFile="espeakng.worker.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}var wasmPageSize=64*1024;var info={"global":null,"env":null,"asm2wasm":asm2wasmImports,"parent":Module};var exports=null;function mergeMemory(newBuffer){var oldBuffer=Module["buffer"];if(newBuffer.byteLength<oldBuffer.byteLength){err("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here")}var oldView=new Int8Array(oldBuffer);var newView=new Int8Array(newBuffer);newView.set(oldView);updateGlobalBuffer(newBuffer);updateGlobalBufferViews()}function getBinary(){try{if(Module["wasmBinary"]){return new Uint8Array(Module["wasmBinary"])}if(Module["readBinary"]){return Module["readBinary"](wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()})).catch((function(){return getBinary()}))}return new Promise((function(resolve,reject){resolve(getBinary())}))}function createWasm(global,env,providedBuffer){if(typeof WebAssembly!=="object"){err("no native wasm support detected");return false}if(!(Module["wasmMemory"]instanceof WebAssembly.Memory)){err("no native wasm Memory in use");return false}env["memory"]=Module["wasmMemory"];info["global"]={"NaN":NaN,"Infinity":Infinity};info["global.Math"]=Math;info["env"]=env;function receiveInstance(instance,module){exports=instance.exports;if(exports.memory)mergeMemory(exports.memory);Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}function receiveInstantiatedSource(output){receiveInstance(output["instance"],output["module"])}function instantiateArrayBuffer(receiver){getBinaryPromise().then((function(binary){return WebAssembly.instantiate(binary,info)})).then(receiver,(function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)}))}if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){WebAssembly.instantiateStreaming(fetch(wasmBinaryFile,{credentials:"same-origin"}),info).then(receiveInstantiatedSource,(function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)}))}else{instantiateArrayBuffer(receiveInstantiatedSource)}return{}}Module["asmPreload"]=Module["asm"];var wasmReallocBuffer=(function(size){var PAGE_MULTIPLE=65536;size=alignUp(size,PAGE_MULTIPLE);var old=Module["buffer"];var oldSize=old.byteLength;try{var result=Module["wasmMemory"].grow((size-oldSize)/wasmPageSize);if(result!==(-1|0)){return Module["buffer"]=Module["wasmMemory"].buffer}else{return null}}catch(e){return null}});Module["reallocBuffer"]=(function(size){return wasmReallocBuffer(size)});Module["asm"]=(function(global,env,providedBuffer){if(!env["table"]){var TABLE_SIZE=Module["wasmTableSize"];var MAX_TABLE_SIZE=Module["wasmMaxTableSize"];if(typeof WebAssembly==="object"&&typeof WebAssembly.Table==="function"){if(MAX_TABLE_SIZE!==undefined){env["table"]=new WebAssembly.Table({"initial":TABLE_SIZE,"maximum":MAX_TABLE_SIZE,"element":"anyfunc"})}else{env["table"]=new WebAssembly.Table({"initial":TABLE_SIZE,element:"anyfunc"})}}else{env["table"]=new Array(TABLE_SIZE)}Module["wasmTable"]=env["table"]}if(!env["__memory_base"]){env["__memory_base"]=Module["STATIC_BASE"]}if(!env["__table_base"]){env["__table_base"]=0}var exports=createWasm(global,env,providedBuffer);return exports})}integrateWasmJS();STATIC_BASE=GLOBAL_BASE;__ATINIT__.push({func:(function(){___emscripten_environ_constructor()})});var STATIC_BUMP=481744;Module["STATIC_BASE"]=STATIC_BASE;Module["STATIC_BUMP"]=STATIC_BUMP;var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV){if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i<strings.length;i++){var line=strings[i];writeAsciiToMemory(line,poolPtr);HEAP32[envPtr+i*ptrSize>>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function _emscripten_get_now(){abort()}function _emscripten_get_now_is_monotonic(){return ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){now=_emscripten_get_now()}else{___setErrNo(22);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function ___clock_gettime(){return _clock_gettime.apply(null,arguments)}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var key in EXCEPTIONS.infos){var ptr=+key;var adj=EXCEPTIONS.infos[ptr].adjusted;var len=adj.length;for(var i=0;i<len;i++){if(adj[i]===adjusted){return ptr}}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___lock(){}function ___map_file(pathname,size){___setErrNo(1);return-1}var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir}),basename:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")})};var TTY={ttys:[],init:(function(){}),shutdown:(function(){}),register:(function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)}),stream_ops:{open:(function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}stream.tty=tty;stream.seekable=false}),close:(function(stream){stream.tty.ops.flush(stream.tty)}),flush:(function(stream){stream.tty.ops.flush(stream.tty)}),read:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i])}}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(length){stream.node.timestamp=Date.now()}return i})},default_tty_ops:{get_char:(function(tty){if(!tty.input.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=new Buffer(BUFSIZE);var bytesRead=0;var isPosixPlatform=process.platform!="win32";var fd=process.stdin.fd;if(isPosixPlatform){var usingDevice=false;try{fd=fs.openSync("/dev/stdin","r");usingDevice=true}catch(e){}}try{bytesRead=fs.readSync(fd,buf,0,BUFSIZE,null)}catch(e){if(e.toString().indexOf("EOF")!=-1)bytesRead=0;else throw e}if(usingDevice){fs.closeSync(fd)}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i<node.usedBytes;++i)arr.push(node.contents[i]);return arr}return node.contents}),getFileDataAsTypedArray:(function(node){if(!node.contents)return new Uint8Array;if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)}),expandFileStorage:(function(node,newCapacity){if(node.contents&&node.contents.subarray&&newCapacity>node.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)|0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.length<newCapacity)node.contents.push(0)}),resizeFileStorage:(function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length<newSize)node.contents.push(0);node.usedBytes=newSize}),node_ops:{getattr:(function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}}),lookup:(function(parent,name){throw FS.genericErrors[ERRNO_CODES.ENOENT]}),mknod:(function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)}),rename:(function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}}}delete old_node.parent.contents[old_node.name];old_node.name=new_name;new_dir.contents[new_name]=old_node;old_node.parent=new_dir}),unlink:(function(parent,name){delete parent.contents[name]}),rmdir:(function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}delete parent.contents[name]}),readdir:(function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries}),symlink:(function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node}),readlink:(function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return node.link})},stream_ops:{read:(function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]}return size}),write:(function(stream,buffer,offset,length,position,canOwn){if(!length)return 0;var node=stream.node;node.timestamp=Date.now();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length}else if(node.usedBytes===0&&position===0){node.contents=new Uint8Array(buffer.subarray(offset,offset+length));node.usedBytes=length;return length}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray)node.contents.set(buffer.subarray(offset,offset+length),position);else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i]}}node.usedBytes=Math.max(node.usedBytes,position+length);return length}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.usedBytes}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position}),allocate:(function(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&(contents.buffer===buffer||contents.buffer===buffer.buffer)){allocated=false;ptr=contents.byteOffset}else{if(position>0||position+length<stream.node.usedBytes){if(contents.subarray){contents=contents.subarray(position,position+length)}else{contents=Array.prototype.slice.call(contents,position,position+length)}}allocated=true;ptr=_malloc(length);if(!ptr){throw new FS.ErrnoError(ERRNO_CODES.ENOMEM)}buffer.set(contents,ptr)}return{ptr:ptr,allocated:allocated}}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(mmapFlags&2){return 0}var bytesWritten=MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0})}};var IDBFS={dbs:{},indexedDB:(function(){if(typeof indexedDB!=="undefined")return indexedDB;var ret=null;if(typeof window==="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;assert(ret,"IDBFS used, but indexedDB not supported");return ret}),DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:(function(mount){return MEMFS.mount.apply(null,arguments)}),syncfs:(function(mount,populate,callback){IDBFS.getLocalSet(mount,(function(err,local){if(err)return callback(err);IDBFS.getRemoteSet(mount,(function(err,remote){if(err)return callback(err);var src=populate?remote:local;var dst=populate?local:remote;IDBFS.reconcile(src,dst,callback)}))}))}),getDB:(function(name,callback){var db=IDBFS.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION)}catch(e){return callback(e)}if(!req){return callback("Unable to connect to IndexedDB")}req.onupgradeneeded=(function(e){var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBFS.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBFS.DB_STORE_NAME)}if(!fileStore.indexNames.contains("timestamp")){fileStore.createIndex("timestamp","timestamp",{unique:false})}});req.onsuccess=(function(){db=req.result;IDBFS.dbs[name]=db;callback(null,db)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),getLocalSet:(function(mount,callback){var entries={};function isRealDir(p){return p!=="."&&p!==".."}function toAbsolute(root){return(function(p){return PATH.join2(root,p)})}var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat;try{stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)))}entries[path]={timestamp:stat.mtime}}return callback(null,{type:"local",entries:entries})}),getRemoteSet:(function(mount,callback){var entries={};IDBFS.getDB(mount.mountpoint,(function(err,db){if(err)return callback(err);try{var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readonly");transaction.onerror=(function(e){callback(this.error);e.preventDefault()});var store=transaction.objectStore(IDBFS.DB_STORE_NAME);var index=store.index("timestamp");index.openKeyCursor().onsuccess=(function(event){var cursor=event.target.result;if(!cursor){return callback(null,{type:"remote",db:db,entries:entries})}entries[cursor.primaryKey]={timestamp:cursor.key};cursor.continue()})}catch(e){return callback(e)}}))}),loadLocalEntry:(function(path,callback){var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){return callback(null,{timestamp:stat.mtime,mode:stat.mode})}else if(FS.isFile(stat.mode)){node.contents=MEMFS.getFileDataAsTypedArray(node);return callback(null,{timestamp:stat.mtime,mode:stat.mode,contents:node.contents})}else{return callback(new Error("node type not supported"))}}),storeLocalEntry:(function(path,entry,callback){try{if(FS.isDir(entry.mode)){FS.mkdir(path,entry.mode)}else if(FS.isFile(entry.mode)){FS.writeFile(path,entry.contents,{canOwn:true})}else{return callback(new Error("node type not supported"))}FS.chmod(path,entry.mode);FS.utime(path,entry.timestamp,entry.timestamp)}catch(e){return callback(e)}callback(null)}),removeLocalEntry:(function(path,callback){try{var lookup=FS.lookupPath(path);var stat=FS.stat(path);if(FS.isDir(stat.mode)){FS.rmdir(path)}else if(FS.isFile(stat.mode)){FS.unlink(path)}}catch(e){return callback(e)}callback(null)}),loadRemoteEntry:(function(store,path,callback){var req=store.get(path);req.onsuccess=(function(event){callback(null,event.target.result)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),storeRemoteEntry:(function(store,path,entry,callback){var req=store.put(entry,path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),removeRemoteEntry:(function(store,path,callback){var req=store.delete(path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),reconcile:(function(src,dst,callback){var total=0;var create=[];Object.keys(src.entries).forEach((function(key){var e=src.entries[key];var e2=dst.entries[key];if(!e2||e.timestamp>e2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process["binding"]("constants");if(flags["fs"]){flags=flags["fs"]}NODEFS.flagsForNodeMap={"1024":flags["O_APPEND"],"64":flags["O_CREAT"],"128":flags["O_EXCL"],"0":flags["O_RDONLY"],"2":flags["O_RDWR"],"4096":flags["O_SYNC"],"512":flags["O_TRUNC"],"1":flags["O_WRONLY"]}}),bufferFrom:(function(arrayBuffer){return Buffer.alloc?Buffer.from(arrayBuffer):new Buffer(arrayBuffer)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsForNode:(function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k}}if(!flags){return newFlags}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),write:(function(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i<parts.length-1;i++){var curr=parts.slice(0,i+1).join("/");if(!createdParents[curr]){createdParents[curr]=WORKERFS.createNode(parent,parts[i],WORKERFS.DIR_MODE,0)}parent=createdParents[curr]}return parent}function base(path){var parts=path.split("/");return parts[parts.length-1]}Array.prototype.forEach.call(mount.opts["files"]||[],(function(file){WORKERFS.createNode(ensureParent(file.name),base(file.name),WORKERFS.FILE_MODE,0,file,file.lastModifiedDate)}));(mount.opts["blobs"]||[]).forEach((function(obj){WORKERFS.createNode(ensureParent(obj["name"]),base(obj["name"]),WORKERFS.FILE_MODE,0,obj["data"])}));(mount.opts["packages"]||[]).forEach((function(pack){pack["metadata"].files.forEach((function(file){var name=file.filename.substr(1);WORKERFS.createNode(ensureParent(name),base(name),WORKERFS.FILE_MODE,0,pack["blob"].slice(file.start,file.end))}))}));return root}),createNode:(function(parent,name,mode,dev,contents,mtime){var node=FS.createNode(parent,name,mode);node.mode=mode;node.node_ops=WORKERFS.node_ops;node.stream_ops=WORKERFS.stream_ops;node.timestamp=(mtime||new Date).getTime();assert(WORKERFS.FILE_MODE!==WORKERFS.DIR_MODE);if(mode===WORKERFS.FILE_MODE){node.size=contents.size;node.contents=contents}else{node.size=4096;node.contents={}}if(parent){parent.contents[name]=node}return node}),node_ops:{getattr:(function(node){return{dev:1,ino:undefined,mode:node.mode,nlink:1,uid:0,gid:0,rdev:undefined,size:node.size,atime:new Date(node.timestamp),mtime:new Date(node.timestamp),ctime:new Date(node.timestamp),blksize:4096,blocks:Math.ceil(node.size/4096)}}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}}),lookup:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}),mknod:(function(parent,name,mode,dev){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rename:(function(oldNode,newDir,newName){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),unlink:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rmdir:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readdir:(function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries}),symlink:(function(parent,newName,oldPath){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readlink:(function(node){throw new FS.ErrnoError(ERRNO_CODES.EPERM)})},stream_ops:{read:(function(stream,buffer,offset,length,position){if(position>=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(40)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count});current=lookup.node;if(count++>40){throw new FS.ErrnoError(40)}}}}return{path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0}return(parentid+hash>>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return 13}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return 13}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return 13}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return 13;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return 17}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return 20}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 16}}else{if(FS.isDir(node.mode)){return 21}}return 0}),mayOpen:(function(node,flags){if(!node){return 2}if(FS.isLink(node.mode)){return 40}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 21}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(24)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(29)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(16)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(16)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(20)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(22)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(22)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(1)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdirTree:(function(path,mode){var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode)}catch(e){if(e.errno!=17)throw e}}}),mkdev:(function(path,mode,dev){if(typeof dev==="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)}),symlink:(function(oldpath,newpath){if(!PATH.resolve(oldpath)){throw new FS.ErrnoError(2)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(2)}var newname=PATH.basename(newpath);var err=FS.mayCreate(parent,newname);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(1)}return parent.node_ops.symlink(parent,newname,oldpath)}),rename:(function(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;try{lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node}catch(e){throw new FS.ErrnoError(16)}if(!old_dir||!new_dir)throw new FS.ErrnoError(2);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(18)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(22)}relative=PATH.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(39)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var err=FS.mayDelete(old_dir,old_name,isdir);if(err){throw new FS.ErrnoError(err)}err=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(err){throw new FS.ErrnoError(err)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(1)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(16)}if(new_dir!==old_dir){err=FS.nodePermissions(old_dir,"w");if(err){throw new FS.ErrnoError(err)}}try{if(FS.trackingDelegate["willMovePath"]){FS.trackingDelegate["willMovePath"](old_path,new_path)}}catch(e){console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}try{if(FS.trackingDelegate["onMovePath"])FS.trackingDelegate["onMovePath"](old_path,new_path)}catch(e){console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}}),rmdir:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,true);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(1)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(16)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(20)}return node.node_ops.readdir(node)}),unlink:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,false);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(1)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(16)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.unlink(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readlink:(function(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(2)}if(!link.node_ops.readlink){throw new FS.ErrnoError(22)}return PATH.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))}),stat:(function(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(2)}if(!node.node_ops.getattr){throw new FS.ErrnoError(1)}return node.node_ops.getattr(node)}),lstat:(function(path){return FS.stat(path,true)}),chmod:(function(path,mode,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(1)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})}),lchmod:(function(path,mode){FS.chmod(path,mode,true)}),fchmod:(function(fd,mode){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(9)}FS.chmod(stream.node,mode)}),chown:(function(path,uid,gid,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(1)}node.node_ops.setattr(node,{timestamp:Date.now()})}),lchown:(function(path,uid,gid){FS.chown(path,uid,gid,true)}),fchown:(function(fd,uid,gid){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(9)}FS.chown(stream.node,uid,gid)}),truncate:(function(path,len){if(len<0){throw new FS.ErrnoError(22)}var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(1)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(21)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(22)}var err=FS.nodePermissions(node,"w");if(err){throw new FS.ErrnoError(err)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})}),ftruncate:(function(fd,len){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(9)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(22)}FS.truncate(stream.node,len)}),utime:(function(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})}),open:(function(path,flags,mode,fd_start,fd_end){if(path===""){throw new FS.ErrnoError(2)}flags=typeof flags==="string"?FS.modeStringToFlags(flags):flags;mode=typeof mode==="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path==="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(17)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(2)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(20)}if(!created){var err=FS.mayOpen(node,flags);if(err){throw new FS.ErrnoError(err)}}if(flags&512){FS.truncate(node,0)}flags&=~(128|512);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false},fd_start,fd_end);if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;console.log("FS.trackingDelegate error on read file: "+path)}}try{if(FS.trackingDelegate["onOpenFile"]){var trackingFlags=0;if((flags&2097155)!==1){trackingFlags|=FS.tracking.openFlags.READ}if((flags&2097155)!==0){trackingFlags|=FS.tracking.openFlags.WRITE}FS.trackingDelegate["onOpenFile"](path,trackingFlags)}}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: "+e.message)}return stream}),close:(function(stream){if(FS.isClosed(stream)){throw new FS.ErrnoError(9)}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}stream.fd=null}),isClosed:(function(stream){return stream.fd===null}),llseek:(function(stream,offset,whence){if(FS.isClosed(stream)){throw new FS.ErrnoError(9)}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(29)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position}),read:(function(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(22)}if(FS.isClosed(stream)){throw new FS.ErrnoError(9)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(9)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(21)}if(!stream.stream_ops.read){throw new FS.ErrnoError(22)}var seeking=typeof position!=="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(29)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead}),write:(function(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(22)}if(FS.isClosed(stream)){throw new FS.ErrnoError(9)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(9)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(21)}if(!stream.stream_ops.write){throw new FS.ErrnoError(22)}if(stream.flags&1024){FS.llseek(stream,0,2)}var seeking=typeof position!=="undefined";if(!seeking){position=stream.position}else if(!stream.seekable){throw new FS.ErrnoError(29)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;try{if(stream.path&&FS.trackingDelegate["onWriteToFile"])FS.trackingDelegate["onWriteToFile"](stream.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return bytesWritten}),allocate:(function(stream,offset,length){if(FS.isClosed(stream)){throw new FS.ErrnoError(9)}if(offset<0||length<=0){throw new FS.ErrnoError(22)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(9)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(19)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(95)}stream.stream_ops.allocate(stream,offset,length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if((stream.flags&2097155)===1){throw new FS.ErrnoError(13)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(19)}return stream.stream_ops.mmap(stream,buffer,offset,length,position,prot,flags)}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!stream||!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)}),munmap:(function(stream){return 0}),ioctl:(function(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(25)}return stream.stream_ops.ioctl(stream,cmd,arg)}),readFile:(function(path,opts){opts=opts||{};opts.flags=opts.flags||"r";opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret}),writeFile:(function(path,data,opts){opts=opts||{};opts.flags=opts.flags||"w";var stream=FS.open(path,opts.flags,opts.mode);if(typeof data==="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,undefined,opts.canOwn)}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)}),cwd:(function(){return FS.currentPath}),chdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(2)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(20)}var err=FS.nodePermissions(lookup.node,"x");if(err){throw new FS.ErrnoError(err)}FS.currentPath=lookup.path}),createDefaultDirectories:(function(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")}),createDefaultDevices:(function(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:(function(){return 0}),write:(function(stream,buffer,offset,length,pos){return length})});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var random_device;if(typeof crypto!=="undefined"){var randomBuffer=new Uint8Array(1);random_device=(function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]})}else if(ENVIRONMENT_IS_NODE){random_device=(function(){return require("crypto")["randomBytes"](1)[0]})}else{random_device=(function(){abort("random_device")})}FS.createDevice("/dev","random",random_device);FS.createDevice("/dev","urandom",random_device);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")}),createSpecialDirectories:(function(){FS.mkdir("/proc");FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:(function(){var node=FS.createNode("/proc/self","fd",16384|511,73);node.node_ops={lookup:(function(parent,name){var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(9);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:(function(){return stream.path})}};ret.parent=ret;return ret})};return node})},{},"/proc/self/fd")}),createStandardStreams:(function(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin","r");assert(stdin.fd===0,"invalid handle for stdin ("+stdin.fd+")");var stdout=FS.open("/dev/stdout","w");assert(stdout.fd===1,"invalid handle for stdout ("+stdout.fd+")");var stderr=FS.open("/dev/stderr","w");assert(stderr.fd===2,"invalid handle for stderr ("+stderr.fd+")")}),ensureErrnoError:(function(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.node=node;this.setErrno=(function(errno){this.errno=errno});this.setErrno(errno);this.message="FS error";if(this.stack)Object.defineProperty(this,"stack",{value:(new Error).stack,writable:true})};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[2].forEach((function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>"}))}),staticInit:(function(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS,"NODEFS":NODEFS,"WORKERFS":WORKERFS}}),init:(function(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()}),quit:(function(){FS.init.initialized=false;var fflush=Module["_fflush"];if(fflush)fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue}FS.close(stream)}}),getMode:(function(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode}),joinPath:(function(parts,forceRelative){var path=PATH.join.apply(null,parts);if(forceRelative&&path[0]=="/")path=path.substr(1);return path}),absolutePath:(function(relative,base){return PATH.resolve(base,relative)}),standardizePath:(function(path){return PATH.normalize(path)}),findObject:(function(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(ret.exists){return ret.object}else{___setErrNo(ret.error);return null}}),analyzePath:(function(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret}),createFolder:(function(parent,name,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.mkdir(path,mode)}),createPath:(function(parent,path,canRead,canWrite){parent=typeof parent==="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){}parent=current}return current}),createFile:(function(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode)}),createDataFile:(function(parent,name,data,canRead,canWrite,canOwn){var path=name?PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name):parent;var mode=FS.getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data==="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}FS.chmod(node,mode|146);var stream=FS.open(node,"w");FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode)}return node}),createDevice:(function(parent,name,input,output){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:(function(stream){stream.seekable=false}),close:(function(stream){if(output&&output.buffer&&output.buffer.length){output(10)}}),read:(function(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(5)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(11)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(5)}}if(length){stream.node.timestamp=Date.now()}return i})});return FS.mkdev(path,mode,dev)}),createLink:(function(parent,name,target,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);return FS.symlink(target,path)}),forceLoadFile:(function(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;var success=true;if(typeof XMLHttpRequest!=="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")}else if(Module["read"]){try{obj.contents=intArrayFromString(Module["read"](obj.url),true);obj.usedBytes=obj.contents.length}catch(e){success=false}}else{throw new Error("Cannot load without read() or XMLHttpRequest.")}if(!success)___setErrNo(5);return success}),createLazyFile:(function(parent,name,url,canRead,canWrite){function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}LazyUint8Array.prototype.get=function LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:(function(){return this.contents.length})}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(5)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(5)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size};node.stream_ops=stream_ops;return node}),createPreloadedFile:(function(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){Browser.init();var fullname=name?PATH.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp "+fullname);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}var handled=false;Module["preloadPlugins"].forEach((function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,(function(){if(onerror)onerror();removeRunDependency(dep)}));handled=true}}));if(!handled)finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){Browser.asyncLoad(url,(function(byteArray){processData(byteArray)}),onerror)}else{processData(url)}}),indexedDB:(function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB}),DB_NAME:(function(){return"EM_FS_"+window.location.pathname}),DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=function openRequest_onupgradeneeded(){console.log("creating db");var db=openRequest.result;db.createObjectStore(FS.DB_STORE_NAME)};openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;var transaction=db.transaction([FS.DB_STORE_NAME],"readwrite");var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var putRequest=files.put(FS.analyzePath(path).object.contents,path);putRequest.onsuccess=function putRequest_onsuccess(){ok++;if(ok+fail==total)finish()};putRequest.onerror=function putRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror}),loadFilesFromDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=onerror;openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;try{var transaction=db.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){onerror(e);return}var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var getRequest=files.get(path);getRequest.onsuccess=function getRequest_onsuccess(){if(FS.analyzePath(path).exists){FS.unlink(path)}FS.createDataFile(PATH.dirname(path),PATH.basename(path),getRequest.result,true,true,true);ok++;if(ok+fail==total)finish()};getRequest.onerror=function getRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror})};var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:(function(dirfd,path){if(path[0]!=="/"){var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=FS.getStream(dirfd);if(!dirstream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);dir=dirstream.path}path=PATH.join2(dir,path)}return path}),doStat:(function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-ERRNO_CODES.ENOTDIR}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break}return ret}),doWritev:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=UTF8ToString(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall10(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.unlink(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall195(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall220(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),dirp=SYSCALLS.get(),count=SYSCALLS.get();if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var pos=0;while(stream.getdents.length>0&&pos+268<=count){var id;var type;var name=stream.getdents.pop();if(name[0]==="."){id=1;type=4}else{var child=FS.lookupNode(stream.node,name);id=child.id;type=FS.isChrdev(child.mode)?2:FS.isDir(child.mode)?4:FS.isLink(child.mode)?10:8}HEAP32[dirp+pos>>2]=id;HEAP32[dirp+pos+4>>2]=stream.position;HEAP16[dirp+pos+8>>1]=268;HEAP8[dirp+pos+10>>0]=type;stringToUTF8(name,dirp+pos+11,256);pos+=268}return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd};case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0};case 12:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return-1;default:{return-ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall40(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.rmdir(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21509:case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};case 21523:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21524:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function __exit(status){exit(status)}function _exit(status){__exit(status)}function _getenv(name){if(name===0)return 0;name=UTF8ToString(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}var _llvm_cos_f64=Math_cos;var _llvm_sin_f64=Math_sin;function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}function _system(command){___setErrNo(11);return-1}if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else if(typeof self==="object"&&self["performance"]&&typeof self["performance"]["now"]==="function"){_emscripten_get_now=(function(){return self["performance"]["now"]()})}else if(typeof performance==="object"&&typeof performance["now"]==="function"){_emscripten_get_now=(function(){return performance["now"]()})}else{_emscripten_get_now=Date.now}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["wasmTableSize"]=44;Module["wasmMaxTableSize"]=44;function jsCall_ii(index,a1){return functionPointers[index](a1)}function jsCall_iii(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_iiii(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_v(index){functionPointers[index]()}Module.asmGlobalArg={};Module.asmLibraryArg={"h":abort,"v":enlargeMemory,"t":getTotalMemory,"s":abortOnCannotGrowMemory,"n":jsCall_ii,"m":jsCall_iii,"l":jsCall_iiii,"k":jsCall_v,"G":___buildEnvironment,"F":___clock_gettime,"j":___lock,"E":___map_file,"r":___setErrNo,"D":___syscall10,"C":___syscall140,"B":___syscall145,"q":___syscall146,"A":___syscall195,"z":___syscall220,"d":___syscall221,"y":___syscall40,"p":___syscall5,"o":___syscall54,"g":___syscall6,"x":___syscall91,"c":___unlock,"w":_emscripten_memcpy_big,"i":_exit,"b":_getenv,"f":_llvm_cos_f64,"e":_llvm_sin_f64,"u":_system,"a":DYNAMICTOP_PTR};var asm=Module["asm"](Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module["asm"]=asm;var ___emscripten_environ_constructor=Module["___emscripten_environ_constructor"]=(function(){return Module["asm"]["H"].apply(null,arguments)});var ___errno_location=Module["___errno_location"]=(function(){return Module["asm"]["I"].apply(null,arguments)});var _emscripten_bind_VoidPtr___destroy___0=Module["_emscripten_bind_VoidPtr___destroy___0"]=(function(){return Module["asm"]["J"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker___destroy___0=Module["_emscripten_bind_eSpeakNGWorker___destroy___0"]=(function(){return Module["asm"]["K"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0=Module["_emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0"]=(function(){return Module["asm"]["L"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0=Module["_emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0"]=(function(){return Module["asm"]["M"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_get_pitch_0=Module["_emscripten_bind_eSpeakNGWorker_get_pitch_0"]=(function(){return Module["asm"]["N"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_get_rate_0=Module["_emscripten_bind_eSpeakNGWorker_get_rate_0"]=(function(){return Module["asm"]["O"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_get_samplerate_0=Module["_emscripten_bind_eSpeakNGWorker_get_samplerate_0"]=(function(){return Module["asm"]["P"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_get_voices_1=Module["_emscripten_bind_eSpeakNGWorker_get_voices_1"]=(function(){return Module["asm"]["Q"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_pitch_1=Module["_emscripten_bind_eSpeakNGWorker_set_pitch_1"]=(function(){return Module["asm"]["R"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_rate_1=Module["_emscripten_bind_eSpeakNGWorker_set_rate_1"]=(function(){return Module["asm"]["S"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_systemSampleRate_1=Module["_emscripten_bind_eSpeakNGWorker_set_systemSampleRate_1"]=(function(){return Module["asm"]["T"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voice_2=Module["_emscripten_bind_eSpeakNGWorker_set_voice_2"]=(function(){return Module["asm"]["U"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voice_3=Module["_emscripten_bind_eSpeakNGWorker_set_voice_3"]=(function(){return Module["asm"]["V"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voice_4=Module["_emscripten_bind_eSpeakNGWorker_set_voice_4"]=(function(){return Module["asm"]["W"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voice_5=Module["_emscripten_bind_eSpeakNGWorker_set_voice_5"]=(function(){return Module["asm"]["X"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_set_voices_2=Module["_emscripten_bind_eSpeakNGWorker_set_voices_2"]=(function(){return Module["asm"]["Y"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_synth__2=Module["_emscripten_bind_eSpeakNGWorker_synth__2"]=(function(){return Module["asm"]["Z"].apply(null,arguments)});var _emscripten_bind_eSpeakNGWorker_synth_ipa__2=Module["_emscripten_bind_eSpeakNGWorker_synth_ipa__2"]=(function(){return Module["asm"]["_"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT___destroy___0=Module["_emscripten_bind_espeak_EVENT___destroy___0"]=(function(){return Module["asm"]["$"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_audio_position_0=Module["_emscripten_bind_espeak_EVENT_get_audio_position_0"]=(function(){return Module["asm"]["aa"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_length_0=Module["_emscripten_bind_espeak_EVENT_get_length_0"]=(function(){return Module["asm"]["ba"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_sample_0=Module["_emscripten_bind_espeak_EVENT_get_sample_0"]=(function(){return Module["asm"]["ca"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_text_position_0=Module["_emscripten_bind_espeak_EVENT_get_text_position_0"]=(function(){return Module["asm"]["da"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_type_0=Module["_emscripten_bind_espeak_EVENT_get_type_0"]=(function(){return Module["asm"]["ea"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_unique_identifier_0=Module["_emscripten_bind_espeak_EVENT_get_unique_identifier_0"]=(function(){return Module["asm"]["fa"].apply(null,arguments)});var _emscripten_bind_espeak_EVENT_get_user_data_0=Module["_emscripten_bind_espeak_EVENT_get_user_data_0"]=(function(){return Module["asm"]["ga"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE___destroy___0=Module["_emscripten_bind_espeak_VOICE___destroy___0"]=(function(){return Module["asm"]["ha"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_age_0=Module["_emscripten_bind_espeak_VOICE_get_age_0"]=(function(){return Module["asm"]["ia"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_gender_0=Module["_emscripten_bind_espeak_VOICE_get_gender_0"]=(function(){return Module["asm"]["ja"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_identifier_0=Module["_emscripten_bind_espeak_VOICE_get_identifier_0"]=(function(){return Module["asm"]["ka"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_languages_1=Module["_emscripten_bind_espeak_VOICE_get_languages_1"]=(function(){return Module["asm"]["la"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_name_0=Module["_emscripten_bind_espeak_VOICE_get_name_0"]=(function(){return Module["asm"]["ma"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_score_0=Module["_emscripten_bind_espeak_VOICE_get_score_0"]=(function(){return Module["asm"]["na"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_spare_0=Module["_emscripten_bind_espeak_VOICE_get_spare_0"]=(function(){return Module["asm"]["oa"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_variant_0=Module["_emscripten_bind_espeak_VOICE_get_variant_0"]=(function(){return Module["asm"]["pa"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_get_xx1_0=Module["_emscripten_bind_espeak_VOICE_get_xx1_0"]=(function(){return Module["asm"]["qa"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_age_1=Module["_emscripten_bind_espeak_VOICE_set_age_1"]=(function(){return Module["asm"]["ra"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_gender_1=Module["_emscripten_bind_espeak_VOICE_set_gender_1"]=(function(){return Module["asm"]["sa"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_identifier_1=Module["_emscripten_bind_espeak_VOICE_set_identifier_1"]=(function(){return Module["asm"]["ta"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_name_1=Module["_emscripten_bind_espeak_VOICE_set_name_1"]=(function(){return Module["asm"]["ua"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_score_1=Module["_emscripten_bind_espeak_VOICE_set_score_1"]=(function(){return Module["asm"]["va"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_spare_1=Module["_emscripten_bind_espeak_VOICE_set_spare_1"]=(function(){return Module["asm"]["wa"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_variant_1=Module["_emscripten_bind_espeak_VOICE_set_variant_1"]=(function(){return Module["asm"]["xa"].apply(null,arguments)});var _emscripten_bind_espeak_VOICE_set_xx1_1=Module["_emscripten_bind_espeak_VOICE_set_xx1_1"]=(function(){return Module["asm"]["ya"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END"]=(function(){return Module["asm"]["za"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED"]=(function(){return Module["asm"]["Aa"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK"]=(function(){return Module["asm"]["Ba"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED"]=(function(){return Module["asm"]["Ca"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME"]=(function(){return Module["asm"]["Da"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY"]=(function(){return Module["asm"]["Ea"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE"]=(function(){return Module["asm"]["Fa"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE"]=(function(){return Module["asm"]["Ga"].apply(null,arguments)});var _emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD=Module["_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD"]=(function(){return Module["asm"]["Ha"].apply(null,arguments)});var _free=Module["_free"]=(function(){return Module["asm"]["Ia"].apply(null,arguments)});var _malloc=Module["_malloc"]=(function(){return Module["asm"]["Ja"].apply(null,arguments)});var dynCall_v=Module["dynCall_v"]=(function(){return Module["asm"]["Ka"].apply(null,arguments)});Module["asm"]=asm;Module["getMemory"]=getMemory;Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};function run(args){args=args||Module["arguments"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&status===0){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;exitRuntime();if(Module["onExit"])Module["onExit"](status)}Module["quit"](status,new ExitStatus(status))}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}Module["noExitRuntime"]=true;run();function WrapperObject(){}WrapperObject.prototype=Object.create(WrapperObject.prototype);WrapperObject.prototype.constructor=WrapperObject;WrapperObject.prototype.__class__=WrapperObject;WrapperObject.__cache__={};Module["WrapperObject"]=WrapperObject;function getCache(__class__){return(__class__||WrapperObject).__cache__}Module["getCache"]=getCache;function wrapPointer(ptr,__class__){var cache=getCache(__class__);var ret=cache[ptr];if(ret)return ret;ret=Object.create((__class__||WrapperObject).prototype);ret.ptr=ptr;return cache[ptr]=ret}Module["wrapPointer"]=wrapPointer;function castObject(obj,__class__){return wrapPointer(obj.ptr,__class__)}Module["castObject"]=castObject;Module["NULL"]=wrapPointer(0);function destroy(obj){if(!obj["__destroy__"])throw"Error: Cannot destroy object. (Did you create it yourself?)";obj["__destroy__"]();delete getCache(obj.__class__)[obj.ptr]}Module["destroy"]=destroy;function compare(obj1,obj2){return obj1.ptr===obj2.ptr}Module["compare"]=compare;function getPointer(obj){return obj.ptr}Module["getPointer"]=getPointer;function getClass(obj){return obj.__class__}Module["getClass"]=getClass;var ensureCache={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:(function(){if(ensureCache.needed){for(var i=0;i<ensureCache.temps.length;i++){Module["_free"](ensureCache.temps[i])}ensureCache.temps.length=0;Module["_free"](ensureCache.buffer);ensureCache.buffer=0;ensureCache.size+=ensureCache.needed;ensureCache.needed=0}if(!ensureCache.buffer){ensureCache.size+=128;ensureCache.buffer=Module["_malloc"](ensureCache.size);assert(ensureCache.buffer)}ensureCache.pos=0}),alloc:(function(array,view){assert(ensureCache.buffer);var bytes=view.BYTES_PER_ELEMENT;var len=array.length*bytes;len=len+7&-8;var ret;if(ensureCache.pos+len>=ensureCache.size){assert(len>0);ensureCache.needed+=len;ret=Module["_malloc"](len);ensureCache.temps.push(ret)}else{ret=ensureCache.buffer+ensureCache.pos;ensureCache.pos+=len}return ret}),copy:(function(array,view,offset){var offsetShifted=offset;var bytes=view.BYTES_PER_ELEMENT;switch(bytes){case 2:offsetShifted>>=1;break;case 4:offsetShifted>>=2;break;case 8:offsetShifted>>=3;break}for(var i=0;i<array.length;i++){view[offsetShifted+i]=array[i]}})};function ensureString(value){if(typeof value==="string"){var intArray=intArrayFromString(value);var offset=ensureCache.alloc(intArray,HEAP8);ensureCache.copy(intArray,HEAP8,offset);return offset}return value}function eSpeakNGWorker(){this.ptr=_emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0();getCache(eSpeakNGWorker)[this.ptr]=this}eSpeakNGWorker.prototype=Object.create(WrapperObject.prototype);eSpeakNGWorker.prototype.constructor=eSpeakNGWorker;eSpeakNGWorker.prototype.__class__=eSpeakNGWorker;eSpeakNGWorker.__cache__={};Module["eSpeakNGWorker"]=eSpeakNGWorker;eSpeakNGWorker.prototype["synth_"]=eSpeakNGWorker.prototype.synth_=(function(arg0,arg1){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);if(arg1&&typeof arg1==="object")arg1=arg1.ptr;_emscripten_bind_eSpeakNGWorker_synth__2(self,arg0,arg1)});eSpeakNGWorker.prototype["synth_ipa_"]=eSpeakNGWorker.prototype.synth_ipa_=(function(arg0,arg1){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);if(arg1&&typeof arg1==="object")arg1=arg1.ptr;else arg1=ensureString(arg1);return _emscripten_bind_eSpeakNGWorker_synth_ipa__2(self,arg0,arg1)});eSpeakNGWorker.prototype["getSizeOfEventStruct_"]=eSpeakNGWorker.prototype.getSizeOfEventStruct_=(function(){var self=this.ptr;return _emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0(self)});eSpeakNGWorker.prototype["set_voice"]=eSpeakNGWorker.prototype.set_voice=(function(arg0,arg1,arg2,arg3,arg4){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);if(arg1&&typeof arg1==="object")arg1=arg1.ptr;else arg1=ensureString(arg1);if(arg2&&typeof arg2==="object")arg2=arg2.ptr;if(arg3&&typeof arg3==="object")arg3=arg3.ptr;if(arg4&&typeof arg4==="object")arg4=arg4.ptr;if(arg2===undefined){return _emscripten_bind_eSpeakNGWorker_set_voice_2(self,arg0,arg1)}if(arg3===undefined){return _emscripten_bind_eSpeakNGWorker_set_voice_3(self,arg0,arg1,arg2)}if(arg4===undefined){return _emscripten_bind_eSpeakNGWorker_set_voice_4(self,arg0,arg1,arg2,arg3)}return _emscripten_bind_eSpeakNGWorker_set_voice_5(self,arg0,arg1,arg2,arg3,arg4)});eSpeakNGWorker.prototype["set_systemSampleRate"]=eSpeakNGWorker.prototype.set_systemSampleRate=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;return _emscripten_bind_eSpeakNGWorker_set_systemSampleRate_1(self,arg0)});eSpeakNGWorker.prototype["get_voices"]=eSpeakNGWorker.prototype.get_voices=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;return wrapPointer(_emscripten_bind_eSpeakNGWorker_get_voices_1(self,arg0),espeak_VOICE)});eSpeakNGWorker.prototype["set_voices"]=eSpeakNGWorker.prototype.set_voices=(function(arg0,arg1){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;if(arg1&&typeof arg1==="object")arg1=arg1.ptr;_emscripten_bind_eSpeakNGWorker_set_voices_2(self,arg0,arg1)});Object.defineProperty(eSpeakNGWorker.prototype,"voices",{get:eSpeakNGWorker.prototype.get_voices,set:eSpeakNGWorker.prototype.set_voices});eSpeakNGWorker.prototype["get_samplerate"]=eSpeakNGWorker.prototype.get_samplerate=(function(){var self=this.ptr;return _emscripten_bind_eSpeakNGWorker_get_samplerate_0(self)});Object.defineProperty(eSpeakNGWorker.prototype,"samplerate",{get:eSpeakNGWorker.prototype.get_samplerate});eSpeakNGWorker.prototype["get_rate"]=eSpeakNGWorker.prototype.get_rate=(function(){var self=this.ptr;return _emscripten_bind_eSpeakNGWorker_get_rate_0(self)});eSpeakNGWorker.prototype["set_rate"]=eSpeakNGWorker.prototype.set_rate=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_eSpeakNGWorker_set_rate_1(self,arg0)});Object.defineProperty(eSpeakNGWorker.prototype,"rate",{get:eSpeakNGWorker.prototype.get_rate,set:eSpeakNGWorker.prototype.set_rate});eSpeakNGWorker.prototype["get_pitch"]=eSpeakNGWorker.prototype.get_pitch=(function(){var self=this.ptr;return _emscripten_bind_eSpeakNGWorker_get_pitch_0(self)});eSpeakNGWorker.prototype["set_pitch"]=eSpeakNGWorker.prototype.set_pitch=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_eSpeakNGWorker_set_pitch_1(self,arg0)});Object.defineProperty(eSpeakNGWorker.prototype,"pitch",{get:eSpeakNGWorker.prototype.get_pitch,set:eSpeakNGWorker.prototype.set_pitch});eSpeakNGWorker.prototype["__destroy__"]=eSpeakNGWorker.prototype.__destroy__=(function(){var self=this.ptr;_emscripten_bind_eSpeakNGWorker___destroy___0(self)});function espeak_VOICE(){throw"cannot construct a espeak_VOICE, no constructor in IDL"}espeak_VOICE.prototype=Object.create(WrapperObject.prototype);espeak_VOICE.prototype.constructor=espeak_VOICE;espeak_VOICE.prototype.__class__=espeak_VOICE;espeak_VOICE.__cache__={};Module["espeak_VOICE"]=espeak_VOICE;espeak_VOICE.prototype["get_name"]=espeak_VOICE.prototype.get_name=(function(){var self=this.ptr;return Pointer_stringify(_emscripten_bind_espeak_VOICE_get_name_0(self))});espeak_VOICE.prototype["set_name"]=espeak_VOICE.prototype.set_name=(function(arg0){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);_emscripten_bind_espeak_VOICE_set_name_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"name",{get:espeak_VOICE.prototype.get_name,set:espeak_VOICE.prototype.set_name});espeak_VOICE.prototype["get_languages"]=espeak_VOICE.prototype.get_languages=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;return _emscripten_bind_espeak_VOICE_get_languages_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"languages",{get:espeak_VOICE.prototype.get_languages});espeak_VOICE.prototype["get_identifier"]=espeak_VOICE.prototype.get_identifier=(function(){var self=this.ptr;return Pointer_stringify(_emscripten_bind_espeak_VOICE_get_identifier_0(self))});espeak_VOICE.prototype["set_identifier"]=espeak_VOICE.prototype.set_identifier=(function(arg0){var self=this.ptr;ensureCache.prepare();if(arg0&&typeof arg0==="object")arg0=arg0.ptr;else arg0=ensureString(arg0);_emscripten_bind_espeak_VOICE_set_identifier_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"identifier",{get:espeak_VOICE.prototype.get_identifier,set:espeak_VOICE.prototype.set_identifier});espeak_VOICE.prototype["get_gender"]=espeak_VOICE.prototype.get_gender=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_gender_0(self)});espeak_VOICE.prototype["set_gender"]=espeak_VOICE.prototype.set_gender=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_gender_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"gender",{get:espeak_VOICE.prototype.get_gender,set:espeak_VOICE.prototype.set_gender});espeak_VOICE.prototype["get_age"]=espeak_VOICE.prototype.get_age=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_age_0(self)});espeak_VOICE.prototype["set_age"]=espeak_VOICE.prototype.set_age=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_age_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"age",{get:espeak_VOICE.prototype.get_age,set:espeak_VOICE.prototype.set_age});espeak_VOICE.prototype["get_variant"]=espeak_VOICE.prototype.get_variant=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_variant_0(self)});espeak_VOICE.prototype["set_variant"]=espeak_VOICE.prototype.set_variant=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_variant_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"variant",{get:espeak_VOICE.prototype.get_variant,set:espeak_VOICE.prototype.set_variant});espeak_VOICE.prototype["get_xx1"]=espeak_VOICE.prototype.get_xx1=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_xx1_0(self)});espeak_VOICE.prototype["set_xx1"]=espeak_VOICE.prototype.set_xx1=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_xx1_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"xx1",{get:espeak_VOICE.prototype.get_xx1,set:espeak_VOICE.prototype.set_xx1});espeak_VOICE.prototype["get_score"]=espeak_VOICE.prototype.get_score=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_score_0(self)});espeak_VOICE.prototype["set_score"]=espeak_VOICE.prototype.set_score=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_score_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"score",{get:espeak_VOICE.prototype.get_score,set:espeak_VOICE.prototype.set_score});espeak_VOICE.prototype["get_spare"]=espeak_VOICE.prototype.get_spare=(function(){var self=this.ptr;return _emscripten_bind_espeak_VOICE_get_spare_0(self)});espeak_VOICE.prototype["set_spare"]=espeak_VOICE.prototype.set_spare=(function(arg0){var self=this.ptr;if(arg0&&typeof arg0==="object")arg0=arg0.ptr;_emscripten_bind_espeak_VOICE_set_spare_1(self,arg0)});Object.defineProperty(espeak_VOICE.prototype,"spare",{get:espeak_VOICE.prototype.get_spare,set:espeak_VOICE.prototype.set_spare});espeak_VOICE.prototype["__destroy__"]=espeak_VOICE.prototype.__destroy__=(function(){var self=this.ptr;_emscripten_bind_espeak_VOICE___destroy___0(self)});function VoidPtr(){throw"cannot construct a VoidPtr, no constructor in IDL"}VoidPtr.prototype=Object.create(WrapperObject.prototype);VoidPtr.prototype.constructor=VoidPtr;VoidPtr.prototype.__class__=VoidPtr;VoidPtr.__cache__={};Module["VoidPtr"]=VoidPtr;VoidPtr.prototype["__destroy__"]=VoidPtr.prototype.__destroy__=(function(){var self=this.ptr;_emscripten_bind_VoidPtr___destroy___0(self)});function espeak_EVENT(){throw"cannot construct a espeak_EVENT, no constructor in IDL"}espeak_EVENT.prototype=Object.create(WrapperObject.prototype);espeak_EVENT.prototype.constructor=espeak_EVENT;espeak_EVENT.prototype.__class__=espeak_EVENT;espeak_EVENT.__cache__={};Module["espeak_EVENT"]=espeak_EVENT;espeak_EVENT.prototype["get_type"]=espeak_EVENT.prototype.get_type=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_type_0(self)});Object.defineProperty(espeak_EVENT.prototype,"type",{get:espeak_EVENT.prototype.get_type});espeak_EVENT.prototype["get_unique_identifier"]=espeak_EVENT.prototype.get_unique_identifier=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_unique_identifier_0(self)});Object.defineProperty(espeak_EVENT.prototype,"unique_identifier",{get:espeak_EVENT.prototype.get_unique_identifier});espeak_EVENT.prototype["get_text_position"]=espeak_EVENT.prototype.get_text_position=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_text_position_0(self)});Object.defineProperty(espeak_EVENT.prototype,"text_position",{get:espeak_EVENT.prototype.get_text_position});espeak_EVENT.prototype["get_length"]=espeak_EVENT.prototype.get_length=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_length_0(self)});Object.defineProperty(espeak_EVENT.prototype,"length",{get:espeak_EVENT.prototype.get_length});espeak_EVENT.prototype["get_audio_position"]=espeak_EVENT.prototype.get_audio_position=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_audio_position_0(self)});Object.defineProperty(espeak_EVENT.prototype,"audio_position",{get:espeak_EVENT.prototype.get_audio_position});espeak_EVENT.prototype["get_sample"]=espeak_EVENT.prototype.get_sample=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_sample_0(self)});Object.defineProperty(espeak_EVENT.prototype,"sample",{get:espeak_EVENT.prototype.get_sample});espeak_EVENT.prototype["get_user_data"]=espeak_EVENT.prototype.get_user_data=(function(){var self=this.ptr;return _emscripten_bind_espeak_EVENT_get_user_data_0(self)});Object.defineProperty(espeak_EVENT.prototype,"user_data",{get:espeak_EVENT.prototype.get_user_data});espeak_EVENT.prototype["__destroy__"]=espeak_EVENT.prototype.__destroy__=(function(){var self=this.ptr;_emscripten_bind_espeak_EVENT___destroy___0(self)});((function(){function setupEnums(){Module["espeakEVENT_LIST_TERMINATED"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED();Module["espeakEVENT_WORD"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD();Module["espeakEVENT_SENTENCE"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE();Module["espeakEVENT_MARK"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK();Module["espeakEVENT_PLAY"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY();Module["espeakEVENT_END"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END();Module["espeakEVENT_MSG_TERMINATED"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED();Module["espeakEVENT_PHONEME"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME();Module["espeakEVENT_SAMPLERATE"]=_emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE()}if(Module["calledRun"])setupEnums();else addOnPreMain(setupEnums)}))();eSpeakNGWorker.prototype.list_voices=(function(){var voices=[];var i;for(var voice=this.get_voices(i=0);voice.ptr!=0;voice=this.get_voices(++i)){var v={name:voice.get_name(),identifier:voice.get_identifier(),languages:[]};var ii=0;var byte=voice.get_languages(ii);function nullTerminatedString(offset){var str="";var index=offset;var b=voice.get_languages(index++);while(b!=0){str+=String.fromCharCode(b);b=voice.get_languages(index++)}return str}while(byte!=0){var lang={priority:byte,name:nullTerminatedString(++ii)};v.languages.push(lang);ii+=lang.name.length+1;byte=voice.get_languages(ii)}voices.push(v)}return voices});var eventTypes=["list_terminated","word","sentence","mark","play","end","msg_terminated","phoneme","samplerate"];eSpeakNGWorker.prototype.synthesize=(function(aText,aCallback){var eventStructSize=this.getSizeOfEventStruct_();function cb(ptr,length,events_pointer){var data=new Float32Array(length);for(var i=0;i<length;i++){data[i]=getValue(ptr+i*4,"float")}var events=[];var ptr=events_pointer;for(ev=wrapPointer(ptr,espeak_EVENT);ev.get_type()!=Module.espeakEVENT_LIST_TERMINATED;ev=wrapPointer(ptr+=eventStructSize,espeak_EVENT)){events.push({type:eventTypes[ev.get_type()],text_position:ev.get_text_position(),word_length:ev.get_length(),audio_position:ev.get_audio_position()})}return aCallback(data,events)?1:0}var fp=addFunction(cb);this.synth_(aText,fp);removeFunction(fp)});eSpeakNGWorker.prototype.synthesize_ipa=(function(aText,aCallback){var ipaVirtualFileName="espeak-ng-ipa-tmp-"+Math.random().toString().substring(2);var res="";var code=this.synth_ipa_(aText,ipaVirtualFileName);if(code==0)res=FS.readFile(ipaVirtualFileName,{encoding:"utf8"});FS.unlink(ipaVirtualFileName);var ret={code:code,ipa:res};return ret});if(typeof WorkerGlobalScope!=="undefined"){var worker;Module.postRun.push((function(){worker=new eSpeakNGWorker;postMessage("ready")}));onmessage=(function(e){if(!worker){throw"eSpeakNGWorker worker not initialized"}var args=e.data.args;var message={callback:e.data.callback,done:true};if(e.data.method=="synthesize"){args.push((function(samples,events){postMessage({callback:e.data.callback,result:[samples.buffer,events]},[samples.buffer])}))}message.result=[worker[e.data.method].apply(worker,args)];if(e.data.callback)postMessage(message)})}
 
 
 
diff --git a/chrome-extension/js/espeakng.worker.wasm b/chrome-extension/js/espeakng.worker.wasm
index 3245694..f18f8fb 100644
--- a/chrome-extension/js/espeakng.worker.wasm
+++ b/chrome-extension/js/espeakng.worker.wasm
Binary files differ
diff --git a/chrome-extension/streaming_worklet_processor.js b/chrome-extension/streaming_worklet_processor.js
index b56368f..116ded1 100644
--- a/chrome-extension/streaming_worklet_processor.js
+++ b/chrome-extension/streaming_worklet_processor.js
@@ -42,12 +42,8 @@
     if (this.first_) {
       this.first_ = false;
     }
-    for (let channel = 0; channel < output.length; ++channel) {
-      if (output[channel].length != buffer.length) {
-        console.error('Buffer is ' + buffer.length + ' and output channel is =' + output[channel].lengh);
-      }
+    for (let channel = 0; channel < output.length; ++channel)
       output[channel].set(buffer);
-    }
 
     return true;
   }
diff --git a/emscripten/Makefile b/emscripten/Makefile
index 0e458b9..1da22a8 100644
--- a/emscripten/Makefile
+++ b/emscripten/Makefile
@@ -58,6 +58,14 @@
 EM_GLUE_AUTOGEN_CPP=glue.cpp
 EM_GLUE_AUTOGEN_JS=glue.js
 
+# libresample files
+EM_LIBRESAMPLE_FILTERKIT_CPP=third_party/libresample/src/filterkit.c
+EM_LIBRESAMPLE_RESAMPLE_CPP=third_party/libresample/src/resample.c
+EM_LIBRESAMPLE_RESAMPLESUBS_CPP=third_party/libresample/src/resamplesubs.c
+EM_LIBRESAMPLE_FILTERKIT_OBJ=third_party/libresample/src/filterkit.o
+EM_LIBRESAMPLE_RESAMPLE_OBJ=third_party/libresample/src/resample.o
+EM_LIBRESAMPLE_RESAMPLESUBS_OBJ=third_party/libresample/src/resamplesubs.o
+
 # NOTE: preload espeak-ng-data directory...
 EM_DATA_DIR=../espeak-ng-data
 # NOTE: ... but exclude these subdirectories/files
@@ -82,7 +90,7 @@
 # ./emconfigure ./configure --prefix=/usr --without-async
 # ./emmake make
 CXXFLAGS+=-DESPEAK_DATA_PATH=\"$(EM_VIRTUAL_PATH_ESPEAKNG_DATA)\"
-CXXFLAGS+=-I ./ -I ../ -I ../src/include/espeak-ng
+CXXFLAGS+=-I ./ -I ../ -I ../src/include/espeak-ng -I third_party/libresample/src -I third_party/libresample/include
 
 # NOTE: so far, pthread is not supported in any browser
 #       except Firefox Nightly.
@@ -94,9 +102,8 @@
 #CXXFLAGS+=-s USE_PTHREADS=1
 
 # NOTE: extra flags for emscripten
-EM_CXXFLAGS=-s RESERVED_FUNCTION_POINTERS=2 --memory-init-file 0 -s FORCE_FILESYSTEM=1 -s WASM=1
-
-
+CXXFLAGS+=-s RESERVED_FUNCTION_POINTERS=2 --memory-init-file 0 -s FORCE_FILESYSTEM=1 -s WASM=1
+CFLAGS+=-s RESERVED_FUNCTION_POINTERS=2 --memory-init-file 0 -s FORCE_FILESYSTEM=1 -s WASM=1
 
 ###############################################################################
 # NOTE: actual targets
@@ -119,7 +126,11 @@
 
 $(EM_GLUE_OBJ): $(EM_GLUE_CPP)
 
-$(EM_WORKER_JS): $(EM_GLUE_AUTOGEN_CPP) $(EM_GLUE_OBJ) $(EM_ALL_PRE_JS) $(EM_ALL_POST_JS)
+$(EM_LIBRESAMPLE_FILTERKIT_OBJ): $(EM_LIBRESAMPLE_FILTERKIT_CPP)
+$(EM_LIBRESAMPLE_RESAMPLE_OBJ): $(EM_LIBRESAMPLE_RESAMPLE_CPP)
+$(EM_LIBRESAMPLE_RESAMPLESUBS_OBJ): $(EM_LIBRESAMPLE_RESAMPLESUBS_CPP)
+
+$(EM_WORKER_JS): $(EM_GLUE_AUTOGEN_CPP) $(EM_GLUE_OBJ) $(EM_LIBRESAMPLE_FILTERKIT_OBJ) $(EM_LIBRESAMPLE_RESAMPLE_OBJ) $(EM_LIBRESAMPLE_RESAMPLESUBS_OBJ) $(EM_ALL_PRE_JS) $(EM_ALL_POST_JS)
 ifeq ($(EM_LIBESPEAKNG),)
 	$(error Unable to find ../src/.libs/libespeak-ng .so or .dylib. Aborting!)
 endif
@@ -127,16 +138,18 @@
 		$(EM_CXXFLAGS) \
 		$(EM_GLUE_OBJ) \
 		$(EM_LIBESPEAKNG) \
+		$(EM_LIBRESAMPLE_FILTERKIT_OBJ) \
+		$(EM_LIBRESAMPLE_RESAMPLESUBS_OBJ) \
+		$(EM_LIBRESAMPLE_RESAMPLE_OBJ) \
 		$(patsubst %,--pre-js %,$(EM_ALL_PRE_JS)) \
 		$(patsubst %,--post-js %,$(EM_ALL_POST_JS)) \
 		-o $@
 
 clean-intermediate:
-	rm -f *.o *.out *.pkl $(EM_GLUE_AUTOGEN_CPP) $(EM_GLUE_AUTOGEN_JS) $(EM_ESPEAKNG_DATA_PACKAGE_JS)
+	rm -f *.o third_party/libresample/src/*.o *.out *.pkl $(EM_GLUE_AUTOGEN_CPP) $(EM_GLUE_AUTOGEN_JS) $(EM_ESPEAKNG_DATA_PACKAGE_JS)
 
 clean: clean-intermediate
 	rm -f $(EM_WORKER_DATA) $(EM_WORKER_JS) $(EM_PTHREAD_MAIN_JS)
 
 help:
 	echo "Available targets: all clean clean-intermediate help"
-
diff --git a/emscripten/espeakng_glue.cpp b/emscripten/espeakng_glue.cpp
index 24398dc..ca00cdd 100644
--- a/emscripten/espeakng_glue.cpp
+++ b/emscripten/espeakng_glue.cpp
@@ -19,23 +19,91 @@
 #include <stdlib.h>
 #include <emscripten.h>
 #include "speak_lib.h"
+#include "libresample.h"
 
-static int gSamplerate = 0;
+typedef int (JavaScriptCallbackType)(
+    float* wav, int inSampleCount, espeak_EVENT *events);
+
+static double gEspeakSampleRate = 0;
+static double gSystemSampleRate = 0;
+static double gFactor = 0;
+static JavaScriptCallbackType* gJavaScriptCallback = 0;
+static void* gResampleHandle = 0;
+
+// From espeak-ng.h
+extern "C"
+{
+extern int espeak_ng_GetSampleRate(void);
+}
+
+static int resampleCallback(short* wav,
+                            int inSampleCount,
+                            espeak_EVENT *events) {
+  const int bufferSize = 32768;
+  static float inBuffer[bufferSize];
+  static float outBuffer[bufferSize];
+
+  if (inSampleCount > bufferSize) {
+    fprintf(stderr, "Error: got more samples than buffer size\n");
+    return 0;
+  }
+
+  for (int i = 0; i < inSampleCount; i++) {
+    inBuffer[i] = wav[i] / 32768.0;
+  }
+
+  int lastFlag = 0;
+
+  espeak_EVENT* event = events;
+  while (event->type != espeakEVENT_LIST_TERMINATED) {
+    if (event->type == espeakEVENT_END)
+      lastFlag = 1;
+    event++;
+  }
+
+  int inBufferUsed = 0;
+  int outSampleCount = resample_process(gResampleHandle,
+                                        gFactor,
+                                        inBuffer,
+                                        inSampleCount,
+                                        lastFlag,
+                                        &inBufferUsed,
+                                        outBuffer,
+                                        bufferSize);
+
+  gJavaScriptCallback(outBuffer, outSampleCount, events);
+  return 0;
+}
 
 class eSpeakNGWorker {
 public:
   eSpeakNGWorker() : rate(espeakRATE_NORMAL), pitch(50), current_voice(NULL) {
-    if (!gSamplerate) {
-      gSamplerate = espeak_Initialize(
-        AUDIO_OUTPUT_SYNCHRONOUS, 100, NULL, espeakINITIALIZE_DONT_EXIT);
+    if (!gEspeakSampleRate) {
+      gEspeakSampleRate = espeak_Initialize(
+          AUDIO_OUTPUT_SYNCHRONOUS, 100, NULL, espeakINITIALIZE_DONT_EXIT);
     }
-    samplerate = gSamplerate;
+    samplerate = gEspeakSampleRate;
     voices = espeak_ListVoices(NULL);
   }
 
   void synth_(const char* aText, void* aCallback) {
-    t_espeak_callback* cb = reinterpret_cast<t_espeak_callback*>(aCallback);
-    espeak_SetSynthCallback(cb);
+    if (gEspeakSampleRate < 8000 || gEspeakSampleRate > 96000) {
+      fprintf(stderr, "Bad espeak sample rate: %.1f\n", gEspeakSampleRate);
+      exit(0);
+    }
+    if (gSystemSampleRate < 8000 || gSystemSampleRate > 96000) {
+      fprintf(stderr, "Bad system sample rate: %.1f\n", gSystemSampleRate);
+      exit(0);
+    }
+
+    gFactor = gSystemSampleRate / gEspeakSampleRate;
+
+    gJavaScriptCallback = reinterpret_cast<JavaScriptCallbackType*>(aCallback);
+    gResampleHandle = resample_open(/* highQuality = */ 1,
+                                    gFactor,
+                                    gFactor);
+    espeak_SetSynthCallback(
+        reinterpret_cast<t_espeak_callback*>(resampleCallback));
     espeak_SetParameter(espeakPITCH, pitch, 0);
     espeak_SetParameter(espeakRATE, rate, 0);
 
@@ -48,6 +116,8 @@
 
     // Reset callback so other instances will work too.
     espeak_SetSynthCallback(NULL);
+
+    resample_close(gResampleHandle);
   }
 
   int synth_ipa_(const char* aText, const char* virtualFileName) {
@@ -57,35 +127,39 @@
     bit 7:   use (bits 8-23) as a tie within multi-letter phonemes names
     bits 8-23:  separator character, between phoneme names
   */
-    
+
     espeak_SetSynthCallback(NULL);
-        
+
     int phoneme_options               = (1 << 1); // Use IPA
     int use_custom_phoneme_separator  = (0 << 7);
     int phonemes_separator            = ' '; // Use a default value
 
     int phoneme_conf                  = phoneme_options | (phonemes_separator << 8);
-    
+
     FILE* f_phonemes_out = fopen(virtualFileName,"wb");
     if(!f_phonemes_out)
       return -1;
-    
+
     //espeak_ng_InitializeOutput(ENOUTPUT_MODE_SYNCHRONOUS, 0, NULL);
     espeak_SetPhonemeTrace(phoneme_conf, f_phonemes_out);
     espeak_Synth(aText, 0, 0, POS_CHARACTER, 0, 0, NULL, NULL);
     espeak_SetPhonemeTrace(0, NULL);
     fclose(f_phonemes_out);
-    
+
+    return 0;
+  }
+
+  long set_systemSampleRate(int rate) {
+    gSystemSampleRate = rate;
     return 0;
   }
 
   long set_voice(
-        const char* aName,
-        const char* aLang=NULL,
-        unsigned char aGender=0,
-        unsigned char aAge=0,
-        unsigned char aVariant = 0
-    ) {
+      const char* aName,
+      const char* aLang=NULL,
+      unsigned char aGender=0,
+      unsigned char aAge=0,
+      unsigned char aVariant = 0) {
     long result = 0;
     if (aLang || aGender || aAge || aVariant) {
       espeak_VOICE props = { 0 };
@@ -120,4 +194,3 @@
 };
 
 #include <glue.cpp>
-
diff --git a/emscripten/espeakng_glue.idl b/emscripten/espeakng_glue.idl
index cac4299..1495538 100644
--- a/emscripten/espeakng_glue.idl
+++ b/emscripten/espeakng_glue.idl
@@ -55,6 +55,7 @@
   long synth_ipa_(DOMString aText, DOMString virtualFileName);
   long getSizeOfEventStruct_();
   long set_voice(DOMString aName, DOMString aLang, optional octet gender=0, optional octet age=0, optional octet aVariant=0);
+  long set_systemSampleRate(long rate);
   [Const] attribute espeak_VOICE[] voices;
   readonly attribute long samplerate;
   attribute long rate;
diff --git a/emscripten/js/espeakng.js b/emscripten/js/espeakng.js
index a225835..32e5b88 100644
--- a/emscripten/js/espeakng.js
+++ b/emscripten/js/espeakng.js
@@ -63,6 +63,7 @@
     'set_rate',
     'set_pitch',
     'set_voice',
+    'set_systemSampleRate',
     'synthesize',
     'synthesize_ipa'
     ]) {
diff --git a/emscripten/js/espeakng.worker.wasm b/emscripten/js/espeakng.worker.wasm
index 3245694..f18f8fb 100644
--- a/emscripten/js/espeakng.worker.wasm
+++ b/emscripten/js/espeakng.worker.wasm
Binary files differ
diff --git a/emscripten/post.js b/emscripten/post.js
index 045f38c..c2704c6 100644
--- a/emscripten/post.js
+++ b/emscripten/post.js
@@ -68,10 +68,9 @@
 eSpeakNGWorker.prototype.synthesize = function (aText, aCallback) {
   var eventStructSize = this.getSizeOfEventStruct_();
   function cb(ptr, length, events_pointer) {
-    var data = new Float32Array(length*2);
+    var data = new Float32Array(length);
     for (var i = 0; i < length; i++) {
-      data[i*2] = Math.max(-1, Math.min(1, getValue(ptr + i*2, 'i16') / 32768));
-      data[i*2+1] = data[i*2];
+      data[i] = getValue(ptr + i*4, 'float');
     }
     var events = [];
     var ptr = events_pointer;
@@ -94,24 +93,24 @@
 };
 
 eSpeakNGWorker.prototype.synthesize_ipa = function (aText, aCallback) {
-  
+
   // Use a unique temp file for the worker. Avoid collisions, just in case.
   var ipaVirtualFileName = "espeak-ng-ipa-tmp-"  + Math.random().toString().substring(2);
-  
+
   var res = "";
   var code = this.synth_ipa_(aText, ipaVirtualFileName);
 
   if(code == 0)
     res = FS.readFile(ipaVirtualFileName, { encoding: 'utf8' })
-    
+
   // Clean up the tmp file
   FS.unlink(ipaVirtualFileName);
-    
+
   var ret = {
     code: code,
     ipa: res
   }
-  
+
   return ret;
 };
 
@@ -126,7 +125,7 @@
   });
 
   onmessage = function(e) {
-    
+
     if (!worker) {
       throw 'eSpeakNGWorker worker not initialized';
     }
diff --git a/emscripten/third_party/libresample/README.md b/emscripten/third_party/libresample/README.md
new file mode 100644
index 0000000..9b09bb9
--- /dev/null
+++ b/emscripten/third_party/libresample/README.md
@@ -0,0 +1,117 @@
+libresample
+===========
+
+Real-time library interface by Dominic Mazzoni
+
+Based on resample-1.7:
+  http://www-ccrma.stanford.edu/~jos/resample/
+
+Two licenses available:
+License: LGPL - see LICENSE-LGPL.txt
+License: BSD - see LICENSE-BSD.txt
+
+History:
+
+This library is not the highest-quality resampling library
+available, nor is it the most flexible, nor is it the
+fastest.  But it is pretty good in all of these regards, and
+it is quite portable.  The best resampling library I am aware
+of is libsamplerate by Erik de Castro Lopo.  It's small, fast,
+and very high quality.  However, it uses the GPL for its
+license (with commercial options available) and I needed
+a more free library.  So I wrote this library, using
+the LGPL resample-1.7 library by Julius Smith as a basis.
+
+Resample-1.7 is a fixed-point resampler, and as a result
+has only limited precision.  I rewrote it to use single-precision
+floating-point arithmetic instead and increased the number
+of filter coefficients between time steps significantly.
+On modern processors it can resample in real time even
+with this extra overhead.
+
+Resample-1.7 was designed to read and write from files, so
+I removed all of that code and replaced it with an API that
+lets you pass samples in small chunks.  It should be easy
+to link to resample-1.7 as a library.
+
+Changes in version 0.1.3:
+
+* Fixed two bugs that were causing subtle problems
+  on Intel x86 processors due to differences in roundoff errors.
+
+* Prefixed most function names with lrs and changed header file
+  from resample.h to libresample.h, to avoid namespace
+  collisions with existing programs and libraries.
+
+* Added resample_dup (thanks to Glenn Maynard)
+
+* Argument to resample_get_filter_width takes a const void *
+  (thanks to Glenn Maynard)
+
+* resample-sndfile clips output to -1...1 (thanks to Glenn Maynard)
+
+Changes in version 0.1.4:
+
+* Added BSD license, with support from all authors and contributors.
+
+* Uploaded to GitHub: http://github.com/minorninth/libresample
+
+Usage notes:  
+
+- If the output buffer you pass is too small, resample_process
+  may not use any input samples because its internal output
+  buffer is too full to process any more.  So do not assume
+  that it is an error just because no input samples were
+  consumed.  Just keep passing valid output buffers.
+
+- Given a resampling factor f > 1, and a number of input
+  samples n, the number of output samples should be between
+  floor(n - f) and ceil(n + f).  In other words, if you
+  resample 1000 samples at a factor of 8, the number of
+  output samples might be between 7992 and 8008.  Do not
+  assume that it will be exactly 8000.  If you need exactly
+  8000 outputs, pad the input with extra zeros as necessary.
+
+License and warranty:
+
+All of the files in this package are Copyright 2003 by Dominic
+Mazzoni <dominic@minorninth.com>.  This library was based heavily
+on Resample-1.7, Copyright 1994-2002 by Julius O. Smith III
+<jos@ccrma.stanford.edu>, all rights reserved.
+
+Permission to use and copy is granted subject to the terms of the
+"GNU Lesser General Public License" (LGPL) as published by the
+Free Software Foundation; either version 2.1 of the License,
+or any later version.  In addition, Julius O. Smith III requests
+that a copy of any modified files be sent by email to
+jos@ccrma.stanford.edu so that he may incorporate them into the
+CCRMA version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+Permission to use and copy is also granted subject to the terms of the
+BSD license found in LICENSE-BSD.txt.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this
+  list of conditions and the following disclaimer in the documentation and/or
+  other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/emscripten/third_party/libresample/configure.in b/emscripten/third_party/libresample/configure.in
new file mode 100644
index 0000000..339c145
--- /dev/null
+++ b/emscripten/third_party/libresample/configure.in
@@ -0,0 +1,79 @@
+dnl
+dnl libresample configure.in script
+dnl
+dnl Dominic Mazzoni
+dnl
+
+dnl Require autoconf >= 2.13
+AC_PREREQ(2.13)
+
+dnl Init autoconf and make sure configure is being called
+dnl from the right directory
+AC_INIT([src/resample.c])
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_RANLIB
+
+AC_PATH_PROG(AR, ar, no)
+if [[ $AR = "no" ]] ; then
+    AC_MSG_ERROR("Could not find ar - needed to create a library");
+fi
+
+AC_SUBST(TARGETS)
+TARGETS="libresample.a tests/testresample"
+
+AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test], [enable tests using libsndfile and libsamplerate]), test_arg="yes", test_arg="no")
+
+if [[ x$test_arg = "xyes" ]] ; then
+	AC_CHECK_LIB(sndfile, sf_open, have_libsndfile=yes, have_libsndfile=no)
+	AC_CHECK_HEADER(sndfile.h, , have_libsndfile=no)
+
+	if [[ $have_libsndfile = "yes" ]] ; then
+		TARGETS="$TARGETS tests/resample-sndfile"
+	fi
+	
+	AC_CHECK_LIB(samplerate, src_simple, have_libsamplerate=yes, have_libsamplerate=no)
+	AC_CHECK_HEADER(samplerate.h, , have_libsamplerate=no)
+
+	if [[ $have_libsamplerate = "yes" ]] ; then
+		TARGETS="$TARGETS tests/compareresample"
+	fi
+else
+	have_libsamplerate="no"
+	have_libsndfile="no"
+fi
+
+
+AC_CHECK_HEADERS(inttypes.h)
+
+AC_CONFIG_HEADER(src/config.h:src/configtemplate.h)
+AC_OUTPUT([Makefile])
+
+echo ""
+
+if [[ $have_libsamplerate = "yes" ]] ; then
+	echo "Configured to build tests/resample-sndfile using libsndfile"
+	echo ""
+else if [[ x$test_arg = x"yes" ]] ; then
+	echo "Could not find libsndfile - needed if you want to"
+	echo "compile tests/resample-sndfile"
+	echo ""
+	fi
+fi
+
+if [[ $have_libsamplerate = "yes" ]] ; then
+	echo "Configured to build tests/compareresample to compare against"
+   echo "Erik de Castro Lopo's libsamplerate library."
+	echo ""
+else if [[ x$test_arg = x"yes" ]] ; then
+	echo "Could not find libsamplerate - only needed if you want to"
+	echo "compile tests/compareresample to compare their performance."
+	echo ""
+	fi
+fi
+
+echo "Type 'configure --help' to see options."
+echo ""
+echo "Type 'make' to build libresample."
diff --git a/emscripten/third_party/libresample/include/libresample.h b/emscripten/third_party/libresample/include/libresample.h
new file mode 100644
index 0000000..0750fbb
--- /dev/null
+++ b/emscripten/third_party/libresample/include/libresample.h
@@ -0,0 +1,44 @@
+/**********************************************************************
+
+  resample.h
+
+  Real-time library interface by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+**********************************************************************/
+
+#ifndef LIBRESAMPLE_INCLUDED
+#define LIBRESAMPLE_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif	/* __cplusplus */
+
+void *resample_open(int      highQuality,
+                    double   minFactor,
+                    double   maxFactor);
+
+void *resample_dup(const void *handle);
+
+int resample_get_filter_width(const void *handle);
+
+int resample_process(void   *handle,
+                     double  factor,
+                     float  *inBuffer,
+                     int     inBufferLen,
+                     int     lastFlag,
+                     int    *inBufferUsed,
+                     float  *outBuffer,
+                     int     outBufferLen);
+
+void resample_close(void *handle);
+
+#ifdef __cplusplus
+}		/* extern "C" */
+#endif	/* __cplusplus */
+
+#endif /* LIBRESAMPLE_INCLUDED */
diff --git a/emscripten/third_party/libresample/src/configtemplate.h b/emscripten/third_party/libresample/src/configtemplate.h
new file mode 100644
index 0000000..94ae1ce
--- /dev/null
+++ b/emscripten/third_party/libresample/src/configtemplate.h
@@ -0,0 +1,7 @@
+/* Run configure to generate config.h automatically on any
+   system supported by GNU autoconf.  For all other systems,
+   use this file as a template to create config.h
+*/
+
+#undef HAVE_INTTYPES_H
+
diff --git a/emscripten/third_party/libresample/src/filterkit.c b/emscripten/third_party/libresample/src/filterkit.c
new file mode 100644
index 0000000..d4360a4
--- /dev/null
+++ b/emscripten/third_party/libresample/src/filterkit.c
@@ -0,0 +1,215 @@
+/**********************************************************************
+
+  resamplesubs.c
+
+  Real-time library interface by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+  This file provides Kaiser-windowed low-pass filter support,
+  including a function to create the filter coefficients, and
+  two functions to apply the filter at a particular point.
+
+**********************************************************************/
+
+/* Definitions */
+#include "resample_defs.h"
+
+#include "filterkit.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+
+/* LpFilter()
+ *
+ * reference: "Digital Filters, 2nd edition"
+ *            R.W. Hamming, pp. 178-179
+ *
+ * Izero() computes the 0th order modified bessel function of the first kind.
+ *    (Needed to compute Kaiser window).
+ *
+ * LpFilter() computes the coeffs of a Kaiser-windowed low pass filter with
+ *    the following characteristics:
+ *
+ *       c[]  = array in which to store computed coeffs
+ *       frq  = roll-off frequency of filter
+ *       N    = Half the window length in number of coeffs
+ *       Beta = parameter of Kaiser window
+ *       Num  = number of coeffs before 1/frq
+ *
+ * Beta trades the rejection of the lowpass filter against the transition
+ *    width from passband to stopband.  Larger Beta means a slower
+ *    transition and greater stopband rejection.  See Rabiner and Gold
+ *    (Theory and Application of DSP) under Kaiser windows for more about
+ *    Beta.  The following table from Rabiner and Gold gives some feel
+ *    for the effect of Beta:
+ *
+ * All ripples in dB, width of transition band = D*N where N = window length
+ *
+ *               BETA    D       PB RIP   SB RIP
+ *               2.120   1.50  +-0.27      -30
+ *               3.384   2.23    0.0864    -40
+ *               4.538   2.93    0.0274    -50
+ *               5.658   3.62    0.00868   -60
+ *               6.764   4.32    0.00275   -70
+ *               7.865   5.0     0.000868  -80
+ *               8.960   5.7     0.000275  -90
+ *               10.056  6.4     0.000087  -100
+ */
+
+#define IzeroEPSILON 1E-21               /* Max error acceptable in Izero */
+
+static double Izero(double x)
+{
+   double sum, u, halfx, temp;
+   int n;
+
+   sum = u = n = 1;
+   halfx = x/2.0;
+   do {
+      temp = halfx/(double)n;
+      n += 1;
+      temp *= temp;
+      u *= temp;
+      sum += u;
+   } while (u >= IzeroEPSILON*sum);
+   return(sum);
+}
+
+void lrsLpFilter(double c[], int N, double frq, double Beta, int Num)
+{
+   double IBeta, temp, temp1, inm1;
+   int i;
+
+   /* Calculate ideal lowpass filter impulse response coefficients: */
+   c[0] = 2.0*frq;
+   for (i=1; i<N; i++) {
+      temp = PI*(double)i/(double)Num;
+      c[i] = sin(2.0*temp*frq)/temp; /* Analog sinc function, cutoff = frq */
+   }
+
+   /* 
+    * Calculate and Apply Kaiser window to ideal lowpass filter.
+    * Note: last window value is IBeta which is NOT zero.
+    * You're supposed to really truncate the window here, not ramp
+    * it to zero. This helps reduce the first sidelobe. 
+    */
+   IBeta = 1.0/Izero(Beta);
+   inm1 = 1.0/((double)(N-1));
+   for (i=1; i<N; i++) {
+      temp = (double)i * inm1;
+      temp1 = 1.0 - temp*temp;
+      temp1 = (temp1<0? 0: temp1); /* make sure it's not negative since
+                                      we're taking the square root - this
+                                      happens on Pentium 4's due to tiny
+                                      roundoff errors */
+      c[i] *= Izero(Beta*sqrt(temp1)) * IBeta;
+   }
+}
+
+float lrsFilterUp(float Imp[],  /* impulse response */
+                  float ImpD[], /* impulse response deltas */
+                  UWORD Nwing,  /* len of one wing of filter */
+                  BOOL Interp,  /* Interpolate coefs using deltas? */
+                  float *Xp,    /* Current sample */
+                  double Ph,    /* Phase */
+                  int Inc)    /* increment (1 for right wing or -1 for left) */
+{
+   float *Hp, *Hdp = NULL, *End;
+   double a = 0;
+   float v, t;
+
+   Ph *= Npc; /* Npc is number of values per 1/delta in impulse response */
+   
+   v = 0.0; /* The output value */
+   Hp = &Imp[(int)Ph];
+   End = &Imp[Nwing];
+   if (Interp) {
+      Hdp = &ImpD[(int)Ph];
+      a = Ph - floor(Ph); /* fractional part of Phase */
+   }
+
+   if (Inc == 1)		/* If doing right wing...              */
+   {				      /* ...drop extra coeff, so when Ph is  */
+      End--;			/*    0.5, we don't do too many mult's */
+      if (Ph == 0)		/* If the phase is zero...           */
+      {			         /* ...then we've already skipped the */
+         Hp += Npc;		/*    first sample, so we must also  */
+         Hdp += Npc;		/*    skip ahead in Imp[] and ImpD[] */
+      }
+   }
+
+   if (Interp)
+      while (Hp < End) {
+         t = *Hp;		/* Get filter coeff */
+         t += (*Hdp)*a; /* t is now interp'd filter coeff */
+         Hdp += Npc;		/* Filter coeff differences step */
+         t *= *Xp;		/* Mult coeff by input sample */
+         v += t;			/* The filter output */
+         Hp += Npc;		/* Filter coeff step */
+         Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+      } 
+   else 
+      while (Hp < End) {
+         t = *Hp;		/* Get filter coeff */
+         t *= *Xp;		/* Mult coeff by input sample */
+         v += t;			/* The filter output */
+         Hp += Npc;		/* Filter coeff step */
+         Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+      }
+   
+   return v;
+}
+
+float lrsFilterUD(float Imp[],  /* impulse response */
+                  float ImpD[], /* impulse response deltas */
+                  UWORD Nwing,  /* len of one wing of filter */
+                  BOOL Interp,  /* Interpolate coefs using deltas? */
+                  float *Xp,    /* Current sample */
+                  double Ph,    /* Phase */
+                  int Inc,    /* increment (1 for right wing or -1 for left) */
+                  double dhb) /* filter sampling period */
+{
+   float a;
+   float *Hp, *Hdp, *End;
+   float v, t;
+   double Ho;
+    
+   v = 0.0; /* The output value */
+   Ho = Ph*dhb;
+   End = &Imp[Nwing];
+   if (Inc == 1)		/* If doing right wing...              */
+   {				      /* ...drop extra coeff, so when Ph is  */
+      End--;			/*    0.5, we don't do too many mult's */
+      if (Ph == 0)		/* If the phase is zero...           */
+         Ho += dhb;		/* ...then we've already skipped the */
+   }				         /*    first sample, so we must also  */
+                        /*    skip ahead in Imp[] and ImpD[] */
+
+   if (Interp)
+      while ((Hp = &Imp[(int)Ho]) < End) {
+         t = *Hp;		/* Get IR sample */
+         Hdp = &ImpD[(int)Ho];  /* get interp bits from diff table*/
+         a = Ho - floor(Ho);	  /* a is logically between 0 and 1 */
+         t += (*Hdp)*a; /* t is now interp'd filter coeff */
+         t *= *Xp;		/* Mult coeff by input sample */
+         v += t;			/* The filter output */
+         Ho += dhb;		/* IR step */
+         Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+      }
+   else 
+      while ((Hp = &Imp[(int)Ho]) < End) {
+         t = *Hp;		/* Get IR sample */
+         t *= *Xp;		/* Mult coeff by input sample */
+         v += t;			/* The filter output */
+         Ho += dhb;		/* IR step */
+         Xp += Inc;		/* Input signal step. NO CHECK ON BOUNDS */
+      }
+
+   return v;
+}
diff --git a/emscripten/third_party/libresample/src/filterkit.h b/emscripten/third_party/libresample/src/filterkit.h
new file mode 100644
index 0000000..eb33b43
--- /dev/null
+++ b/emscripten/third_party/libresample/src/filterkit.h
@@ -0,0 +1,28 @@
+/**********************************************************************
+
+  resamplesubs.c
+
+  Real-time library interface by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+**********************************************************************/
+
+/* Definitions */
+#include "resample_defs.h"
+
+/*
+ * FilterUp() - Applies a filter to a given sample when up-converting.
+ * FilterUD() - Applies a filter to a given sample when up- or down-
+ */
+
+float lrsFilterUp(float Imp[], float ImpD[], UWORD Nwing, BOOL Interp,
+                  float *Xp, double Ph, int Inc);
+
+float lrsFilterUD(float Imp[], float ImpD[], UWORD Nwing, BOOL Interp,
+                  float *Xp, double Ph, int Inc, double dhb);
+
+void lrsLpFilter(double c[], int N, double frq, double Beta, int Num);
diff --git a/emscripten/third_party/libresample/src/resample.c b/emscripten/third_party/libresample/src/resample.c
new file mode 100644
index 0000000..0ba3ca9
--- /dev/null
+++ b/emscripten/third_party/libresample/src/resample.c
@@ -0,0 +1,347 @@
+/**********************************************************************
+
+  resample.c
+
+  Real-time library interface by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+  This is the main source file, implementing all of the API
+  functions and handling all of the buffering logic.
+
+**********************************************************************/
+
+/* External interface */
+#include "../include/libresample.h"
+
+/* Definitions */
+#include "resample_defs.h"
+
+#include "filterkit.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+
+typedef struct {
+   float  *Imp;
+   float  *ImpD;
+   float   LpScl;
+   UWORD   Nmult;
+   UWORD   Nwing;
+   double  minFactor;
+   double  maxFactor;
+   UWORD   XSize;
+   float  *X;
+   UWORD   Xp; /* Current "now"-sample pointer for input */
+   UWORD   Xread; /* Position to put new samples */
+   UWORD   Xoff;
+   UWORD   YSize;
+   float  *Y;
+   UWORD   Yp;
+   double  Time;
+} rsdata;
+
+void *resample_dup(const void *	handle)
+{
+   const rsdata *cpy = (const rsdata *)handle;
+   rsdata *hp = (rsdata *)malloc(sizeof(rsdata));
+
+   hp->minFactor = cpy->minFactor;
+   hp->maxFactor = cpy->maxFactor;
+   hp->Nmult = cpy->Nmult;
+   hp->LpScl = cpy->LpScl;
+   hp->Nwing = cpy->Nwing;
+
+   hp->Imp = (float *)malloc(hp->Nwing * sizeof(float));
+   memcpy(hp->Imp, cpy->Imp, hp->Nwing * sizeof(float));
+   hp->ImpD = (float *)malloc(hp->Nwing * sizeof(float));
+   memcpy(hp->ImpD, cpy->ImpD, hp->Nwing * sizeof(float));
+
+   hp->Xoff = cpy->Xoff;
+   hp->XSize = cpy->XSize;
+   hp->X = (float *)malloc((hp->XSize + hp->Xoff) * sizeof(float));
+   memcpy(hp->X, cpy->X, (hp->XSize + hp->Xoff) * sizeof(float));
+   hp->Xp = cpy->Xp;
+   hp->Xread = cpy->Xread;
+   hp->YSize = cpy->YSize;
+   hp->Y = (float *)malloc(hp->YSize * sizeof(float));
+   memcpy(hp->Y, cpy->Y, hp->YSize * sizeof(float));
+   hp->Yp = cpy->Yp;
+   hp->Time = cpy->Time;
+   
+   return (void *)hp;
+}
+
+void *resample_open(int highQuality, double minFactor, double maxFactor)
+{
+   double *Imp64;
+   double Rolloff, Beta;
+   rsdata *hp;
+   UWORD   Xoff_min, Xoff_max;
+   int i;
+
+   /* Just exit if we get invalid factors */
+   if (minFactor <= 0.0 || maxFactor <= 0.0 || maxFactor < minFactor) {
+      #if DEBUG
+      fprintf(stderr,
+              "libresample: "
+              "minFactor and maxFactor must be positive real numbers,\n"
+              "and maxFactor should be larger than minFactor.\n");
+      #endif
+      return 0;
+   }
+
+   hp = (rsdata *)malloc(sizeof(rsdata));
+
+   hp->minFactor = minFactor;
+   hp->maxFactor = maxFactor;
+ 
+   if (highQuality)
+      hp->Nmult = 35;
+   else
+      hp->Nmult = 11;
+
+   hp->LpScl = 1.0;
+   hp->Nwing = Npc*(hp->Nmult-1)/2; /* # of filter coeffs in right wing */
+
+   Rolloff = 0.90;
+   Beta = 6;
+
+   Imp64 = (double *)malloc(hp->Nwing * sizeof(double));
+
+   lrsLpFilter(Imp64, hp->Nwing, 0.5*Rolloff, Beta, Npc);
+
+   hp->Imp = (float *)malloc(hp->Nwing * sizeof(float));
+   hp->ImpD = (float *)malloc(hp->Nwing * sizeof(float));
+   for(i=0; i<hp->Nwing; i++)
+      hp->Imp[i] = Imp64[i];
+
+   /* Storing deltas in ImpD makes linear interpolation
+      of the filter coefficients faster */
+   for (i=0; i<hp->Nwing-1; i++)
+      hp->ImpD[i] = hp->Imp[i+1] - hp->Imp[i];
+
+   /* Last coeff. not interpolated */
+   hp->ImpD[hp->Nwing-1] = - hp->Imp[hp->Nwing-1];
+
+   free(Imp64);
+
+   /* Calc reach of LP filter wing (plus some creeping room) */
+   Xoff_min = ((hp->Nmult+1)/2.0) * MAX(1.0, 1.0/minFactor) + 10;
+   Xoff_max = ((hp->Nmult+1)/2.0) * MAX(1.0, 1.0/maxFactor) + 10;
+   hp->Xoff = MAX(Xoff_min, Xoff_max);
+
+   /* Make the inBuffer size at least 4096, but larger if necessary
+      in order to store the minimum reach of the LP filter and then some.
+      Then allocate the buffer an extra Xoff larger so that
+      we can zero-pad up to Xoff zeros at the end when we reach the
+      end of the input samples. */
+   hp->XSize = MAX(2*hp->Xoff+10, 4096);
+   hp->X = (float *)malloc((hp->XSize + hp->Xoff) * sizeof(float));
+   hp->Xp = hp->Xoff;
+   hp->Xread = hp->Xoff;
+   
+   /* Need Xoff zeros at begining of X buffer */
+   for(i=0; i<hp->Xoff; i++)
+      hp->X[i]=0;
+
+   /* Make the outBuffer long enough to hold the entire processed
+      output of one inBuffer */
+   hp->YSize = (int)(((double)hp->XSize)*maxFactor+2.0);
+   hp->Y = (float *)malloc(hp->YSize * sizeof(float));
+   hp->Yp = 0;
+
+   hp->Time = (double)hp->Xoff; /* Current-time pointer for converter */
+   
+   return (void *)hp;
+}
+
+int resample_get_filter_width(const void   *handle)
+{
+   const rsdata *hp = (const rsdata *)handle;
+   return hp->Xoff;
+}
+
+int resample_process(void   *handle,
+                     double  factor,
+                     float  *inBuffer,
+                     int     inBufferLen,
+                     int     lastFlag,
+                     int    *inBufferUsed, /* output param */
+                     float  *outBuffer,
+                     int     outBufferLen)
+{
+   rsdata *hp = (rsdata *)handle;
+   float  *Imp = hp->Imp;
+   float  *ImpD = hp->ImpD;
+   float  LpScl = hp->LpScl;
+   UWORD  Nwing = hp->Nwing;
+   BOOL interpFilt = FALSE; /* TRUE means interpolate filter coeffs */
+   int outSampleCount;
+   UWORD Nout, Ncreep, Nreuse;
+   int Nx;
+   int i, len;
+
+   #if DEBUG
+   fprintf(stderr, "resample_process: in=%d, out=%d lastFlag=%d\n",
+           inBufferLen, outBufferLen, lastFlag);
+   #endif
+
+   /* Initialize inBufferUsed and outSampleCount to 0 */
+   *inBufferUsed = 0;
+   outSampleCount = 0;
+
+   if (factor < hp->minFactor || factor > hp->maxFactor) {
+      #if DEBUG
+      fprintf(stderr,
+              "libresample: factor %f is not between "
+              "minFactor=%f and maxFactor=%f",
+              factor, hp->minFactor, hp->maxFactor);
+      #endif
+      return -1;
+   }
+
+   /* Start by copying any samples still in the Y buffer to the output
+      buffer */
+   if (hp->Yp && (outBufferLen-outSampleCount)>0) {
+      len = MIN(outBufferLen-outSampleCount, hp->Yp);
+      for(i=0; i<len; i++)
+         outBuffer[outSampleCount+i] = hp->Y[i];
+      outSampleCount += len;
+      for(i=0; i<hp->Yp-len; i++)
+         hp->Y[i] = hp->Y[i+len];
+      hp->Yp -= len;
+   }
+
+   /* If there are still output samples left, return now - we need
+      the full output buffer available to us... */
+   if (hp->Yp)
+      return outSampleCount;
+
+   /* Account for increased filter gain when using factors less than 1 */
+   if (factor < 1)
+      LpScl = LpScl*factor;
+
+   for(;;) {
+
+      /* This is the maximum number of samples we can process
+         per loop iteration */
+
+      #ifdef DEBUG
+      printf("XSize: %d Xoff: %d Xread: %d Xp: %d lastFlag: %d\n",
+             hp->XSize, hp->Xoff, hp->Xread, hp->Xp, lastFlag);
+      #endif
+
+      /* Copy as many samples as we can from the input buffer into X */
+      len = hp->XSize - hp->Xread;
+
+      if (len >= (inBufferLen - (*inBufferUsed)))
+         len = (inBufferLen - (*inBufferUsed));
+
+      for(i=0; i<len; i++)
+         hp->X[hp->Xread + i] = inBuffer[(*inBufferUsed) + i];
+
+      *inBufferUsed += len;
+      hp->Xread += len;
+
+      if (lastFlag && (*inBufferUsed == inBufferLen)) {
+         /* If these are the last samples, zero-pad the
+            end of the input buffer and make sure we process
+            all the way to the end */
+         Nx = hp->Xread - hp->Xoff;
+         for(i=0; i<hp->Xoff; i++)
+            hp->X[hp->Xread + i] = 0;
+      }
+      else
+         Nx = hp->Xread - 2 * hp->Xoff;
+
+      #ifdef DEBUG
+      fprintf(stderr, "new len=%d Nx=%d\n", len, Nx);
+      #endif
+
+      if (Nx <= 0)
+         break;
+
+      /* Resample stuff in input buffer */
+      if (factor >= 1) {      /* SrcUp() is faster if we can use it */
+         Nout = lrsSrcUp(hp->X, hp->Y, factor, &hp->Time, Nx,
+                         Nwing, LpScl, Imp, ImpD, interpFilt);
+      }
+      else {
+         Nout = lrsSrcUD(hp->X, hp->Y, factor, &hp->Time, Nx,
+                         Nwing, LpScl, Imp, ImpD, interpFilt);
+      }
+
+      #ifdef DEBUG
+      printf("Nout: %d\n", Nout);
+      #endif
+      
+      hp->Time -= Nx;         /* Move converter Nx samples back in time */
+      hp->Xp += Nx;           /* Advance by number of samples processed */
+
+      /* Calc time accumulation in Time */
+      Ncreep = (int)(hp->Time) - hp->Xoff;
+      if (Ncreep) {
+         hp->Time -= Ncreep;  /* Remove time accumulation */
+         hp->Xp += Ncreep;    /* and add it to read pointer */
+      }
+
+      /* Copy part of input signal that must be re-used */
+      Nreuse = hp->Xread - (hp->Xp - hp->Xoff);
+
+      for (i=0; i<Nreuse; i++)
+         hp->X[i] = hp->X[i + (hp->Xp - hp->Xoff)];
+
+      #ifdef DEBUG
+      printf("New Xread=%d\n", Nreuse);
+      #endif
+
+      hp->Xread = Nreuse;  /* Pos in input buff to read new data into */
+      hp->Xp = hp->Xoff;
+      
+      /* Check to see if output buff overflowed (shouldn't happen!) */
+      if (Nout > hp->YSize) {
+         #ifdef DEBUG
+         printf("Nout: %d YSize: %d\n", Nout, hp->YSize);
+         #endif
+         fprintf(stderr, "libresample: Output array overflow!\n");
+         return -1;
+      }
+
+      hp->Yp = Nout;
+
+      /* Copy as many samples as possible to the output buffer */
+      if (hp->Yp && (outBufferLen-outSampleCount)>0) {
+         len = MIN(outBufferLen-outSampleCount, hp->Yp);
+         for(i=0; i<len; i++)
+            outBuffer[outSampleCount+i] = hp->Y[i];
+         outSampleCount += len;
+         for(i=0; i<hp->Yp-len; i++)
+            hp->Y[i] = hp->Y[i+len];
+         hp->Yp -= len;
+      }
+
+      /* If there are still output samples left, return now,
+         since we need the full output buffer available */
+      if (hp->Yp)
+         break;
+   }
+
+   return outSampleCount;
+}
+
+void resample_close(void *handle)
+{
+   rsdata *hp = (rsdata *)handle;
+   free(hp->X);
+   free(hp->Y);
+   free(hp->Imp);
+   free(hp->ImpD);
+   free(hp);
+}
+
diff --git a/emscripten/third_party/libresample/src/resample_defs.h b/emscripten/third_party/libresample/src/resample_defs.h
new file mode 100644
index 0000000..a361f5d
--- /dev/null
+++ b/emscripten/third_party/libresample/src/resample_defs.h
@@ -0,0 +1,86 @@
+/**********************************************************************
+
+  resample_defs.h
+
+  Real-time library interface by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+**********************************************************************/
+
+#ifndef __RESAMPLE_DEFS__
+#define __RESAMPLE_DEFS__
+
+#if !defined(WIN32) && !defined(__CYGWIN__)
+#include "config.h"
+#endif
+
+#ifndef TRUE
+#define TRUE  1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef PI
+#define PI (3.14159265358979232846)
+#endif
+
+#ifndef PI2
+#define PI2 (6.28318530717958465692)
+#endif
+
+#define D2R (0.01745329348)          /* (2*pi)/360 */
+#define R2D (57.29577951)            /* 360/(2*pi) */
+
+#ifndef MAX
+#define MAX(x,y) ((x)>(y) ?(x):(y))
+#endif
+#ifndef MIN
+#define MIN(x,y) ((x)<(y) ?(x):(y))
+#endif
+
+#ifndef ABS
+#define ABS(x)   ((x)<0   ?(-(x)):(x))
+#endif
+
+#ifndef SGN
+#define SGN(x)   ((x)<0   ?(-1):((x)==0?(0):(1)))
+#endif
+
+#if HAVE_INTTYPES_H
+  #include <inttypes.h>
+  typedef char           BOOL;
+  typedef int32_t        WORD;
+  typedef uint32_t       UWORD;
+#else
+  typedef char           BOOL;
+  typedef int            WORD;
+  typedef unsigned int   UWORD;
+#endif
+
+#ifdef DEBUG
+#define INLINE
+#else
+#define INLINE inline
+#endif
+
+/* Accuracy */
+
+#define Npc 4096
+
+/* Function prototypes */
+
+int lrsSrcUp(float X[], float Y[], double factor, double *Time,
+             UWORD Nx, UWORD Nwing, float LpScl,
+             float Imp[], float ImpD[], BOOL Interp);
+
+int lrsSrcUD(float X[], float Y[], double factor, double *Time,
+             UWORD Nx, UWORD Nwing, float LpScl,
+             float Imp[], float ImpD[], BOOL Interp);
+
+#endif
diff --git a/emscripten/third_party/libresample/src/resamplesubs.c b/emscripten/third_party/libresample/src/resamplesubs.c
new file mode 100644
index 0000000..849d160
--- /dev/null
+++ b/emscripten/third_party/libresample/src/resamplesubs.c
@@ -0,0 +1,123 @@
+/**********************************************************************
+
+  resamplesubs.c
+
+  Real-time library interface by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+  This file provides the routines that do sample-rate conversion
+  on small arrays, calling routines from filterkit.
+
+**********************************************************************/
+
+/* Definitions */
+#include "resample_defs.h"
+
+#include "filterkit.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+
+/* Sampling rate up-conversion only subroutine;
+ * Slightly faster than down-conversion;
+ */
+int lrsSrcUp(float X[],
+             float Y[],
+             double factor,
+             double *TimePtr,
+             UWORD Nx,
+             UWORD Nwing,
+             float LpScl,
+             float Imp[],
+             float ImpD[],
+             BOOL Interp)
+{
+    float *Xp, *Ystart;
+    float v;
+    
+    double CurrentTime = *TimePtr;
+    double dt;                 /* Step through input signal */ 
+    double endTime;            /* When Time reaches EndTime, return to user */
+    
+    dt = 1.0/factor;           /* Output sampling period */
+    
+    Ystart = Y;
+    endTime = CurrentTime + Nx;
+    while (CurrentTime < endTime)
+    {
+        double LeftPhase = CurrentTime-floor(CurrentTime);
+        double RightPhase = 1.0 - LeftPhase;
+
+        Xp = &X[(int)CurrentTime]; /* Ptr to current input sample */
+        /* Perform left-wing inner product */
+        v = lrsFilterUp(Imp, ImpD, Nwing, Interp, Xp,
+                        LeftPhase, -1);
+        /* Perform right-wing inner product */
+        v += lrsFilterUp(Imp, ImpD, Nwing, Interp, Xp+1, 
+                         RightPhase, 1);
+
+        v *= LpScl;   /* Normalize for unity filter gain */
+
+        *Y++ = v;               /* Deposit output */
+        CurrentTime += dt;      /* Move to next sample by time increment */
+    }
+
+    *TimePtr = CurrentTime;
+    return (Y - Ystart);        /* Return the number of output samples */
+}
+
+/* Sampling rate conversion subroutine */
+
+int lrsSrcUD(float X[],
+             float Y[],
+             double factor,
+             double *TimePtr,
+             UWORD Nx,
+             UWORD Nwing,
+             float LpScl,
+             float Imp[],
+             float ImpD[],
+             BOOL Interp)
+{
+    float *Xp, *Ystart;
+    float v;
+
+    double CurrentTime = (*TimePtr);
+    double dh;                 /* Step through filter impulse response */
+    double dt;                 /* Step through input signal */
+    double endTime;            /* When Time reaches EndTime, return to user */
+    
+    dt = 1.0/factor;            /* Output sampling period */
+    
+    dh = MIN(Npc, factor*Npc);  /* Filter sampling period */
+    
+    Ystart = Y;
+    endTime = CurrentTime + Nx;
+    while (CurrentTime < endTime)
+    {
+        double LeftPhase = CurrentTime-floor(CurrentTime);
+        double RightPhase = 1.0 - LeftPhase;
+
+        Xp = &X[(int)CurrentTime];     /* Ptr to current input sample */
+        /* Perform left-wing inner product */
+        v = lrsFilterUD(Imp, ImpD, Nwing, Interp, Xp,
+                        LeftPhase, -1, dh);
+        /* Perform right-wing inner product */
+        v += lrsFilterUD(Imp, ImpD, Nwing, Interp, Xp+1, 
+                         RightPhase, 1, dh);
+
+        v *= LpScl;   /* Normalize for unity filter gain */
+        *Y++ = v;               /* Deposit output */
+        
+        CurrentTime += dt;      /* Move to next sample by time increment */
+    }
+
+    *TimePtr = CurrentTime;
+    return (Y - Ystart);        /* Return the number of output samples */
+}
diff --git a/emscripten/third_party/libresample/tests/compareresample.c b/emscripten/third_party/libresample/tests/compareresample.c
new file mode 100644
index 0000000..cbf074d
--- /dev/null
+++ b/emscripten/third_party/libresample/tests/compareresample.c
@@ -0,0 +1,183 @@
+/**********************************************************************
+
+  compareresample.c
+
+  Real-time library interface by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+**********************************************************************/
+
+#include "../include/libresample.h"
+
+#include <samplerate.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include <sys/time.h>
+
+#define MIN(A, B) (A) < (B)? (A) : (B)
+
+void dostat(char *name, float *d1, float *d2, int len)
+{
+   int i;
+   double sum, sumsq, err, rmserr;
+
+   sum = 0.0;
+   sumsq = 0.0;
+   for(i=0; i<len; i++) {
+      double diff = d1[i] - d2[i];
+      sum += fabs(diff);
+      sumsq += diff * diff;
+   }
+   err = sum / len;
+   rmserr = sqrt(sumsq / len);
+   printf("   %s: Avg err: %f RMS err: %f\n", name, err, rmserr);
+}
+
+void runtest(float *src, int srclen,
+             float *ans, int anslen,
+             double factor)
+{
+   struct timeval tv0, tv1;
+   int dstlen = (int)(srclen * factor);
+   float *dst_rs = (float *)malloc((dstlen+100) * sizeof(float));
+   float *dst_rabbit = (float *)malloc((dstlen+100) * sizeof(float));
+   void *handle;
+   SRC_DATA rabbit;
+   double deltat;
+   int srcblocksize = srclen;
+   int dstblocksize = dstlen;
+   int i, out, out_rabbit, o, srcused;
+   int statlen, srcpos;
+
+   /* do resample */
+
+   for(i=0; i<dstlen+100; i++)
+      dst_rs[i] = -99.0;
+
+   gettimeofday(&tv0, NULL);
+
+   handle = resample_open(1, factor, factor);
+   out = 0;
+   srcpos = 0;
+   for(;;) {
+      int srcBlock = MIN(srclen-srcpos, srcblocksize);
+      int lastFlag = (srcBlock == srclen-srcpos);
+
+      o = resample_process(handle, factor,
+                           &src[srcpos], srcBlock,
+                           lastFlag, &srcused,
+                           &dst_rs[out], MIN(dstlen-out, dstblocksize));
+      srcpos += srcused;
+      if (o >= 0)
+         out += o;
+      if (o < 0 || (o == 0 && srcpos == srclen))
+         break;
+   }
+   resample_close(handle);
+
+   gettimeofday(&tv1, NULL);
+   deltat =
+      (tv1.tv_sec + tv1.tv_usec * 0.000001) -
+      (tv0.tv_sec + tv0.tv_usec * 0.000001);
+
+   if (o < 0) {
+      printf("Error: resample_process returned an error: %d\n", o);
+   }
+
+   if (out <= 0) {
+      printf("Error: resample_process returned %d samples\n", out);
+      free(dst_rs);
+      return;
+   }
+
+   printf("   resample: %.3f seconds, %d outputs\n", deltat, out);
+
+   /* do rabbit (Erik's libsamplerate) */
+
+   for(i=0; i<dstlen+100; i++)
+      dst_rabbit[i] = -99.0;
+
+   rabbit.data_in = src;
+   rabbit.data_out = dst_rabbit;
+   rabbit.input_frames = srclen;
+   rabbit.output_frames = dstlen;
+   rabbit.input_frames_used = 0;
+   rabbit.output_frames_gen = 0;
+   rabbit.end_of_input = 1;
+   rabbit.src_ratio = factor;
+
+   gettimeofday(&tv0, NULL);
+
+   /* src_simple(&rabbit, SRC_SINC_BEST_QUALITY, 1); */
+   src_simple(&rabbit, SRC_SINC_FASTEST, 1);
+   /* src_simple(&rabbit, SRC_LINEAR, 1); */
+
+   gettimeofday(&tv1, NULL);
+   deltat =
+      (tv1.tv_sec + tv1.tv_usec * 0.000001) -
+      (tv0.tv_sec + tv0.tv_usec * 0.000001);
+
+   out_rabbit = rabbit.output_frames_gen;
+
+   printf("   rabbit  : %.3f seconds, %d outputs\n",
+          deltat, out_rabbit);
+
+   statlen = MIN(out, out_rabbit);
+   if (anslen > 0)
+      statlen = MIN(statlen, anslen);
+
+   if (ans) {
+      dostat("resample    ", dst_rs, ans, statlen);
+      dostat("rabbit      ", dst_rabbit, ans, statlen);
+   }
+   dostat(   "RS vs rabbit", dst_rs, dst_rabbit, statlen);
+
+   free(dst_rs);
+   free(dst_rabbit);
+}
+
+int main(int argc, char **argv)
+{
+   int i, srclen;
+   float *src, *ans;
+
+   printf("\n*** sin wave, factor = 1.0 *** \n\n");
+   srclen = 100000;
+   src = malloc(srclen * sizeof(float));
+   for(i=0; i<srclen; i++)
+      src[i] = sin(i/100.0);
+
+   runtest(src, srclen, src, srclen, 1.0);
+
+   printf("\n*** sin wave, factor = 0.25 *** \n\n");
+   srclen = 100000;
+   for(i=0; i<srclen; i++)
+      src[i] = sin(i/100.0);
+   ans = malloc((srclen/4) * sizeof(float));
+   for(i=0; i<srclen/4; i++)
+      ans[i] = sin(i/25.0);
+
+   runtest(src, srclen, ans, srclen/4, 0.25);
+   free(ans);
+
+   printf("\n*** sin wave, factor = 4.0 *** \n\n");
+   srclen = 20000;
+   for(i=0; i<srclen; i++)
+      src[i] = sin(i/100.0);
+   ans = malloc((srclen*4) * sizeof(float));
+   for(i=0; i<srclen*4; i++)
+      ans[i] = sin(i/400.0);
+
+   runtest(src, srclen, ans, srclen*4, 4.0);
+   free(ans);
+   free(src);
+
+   return 0;
+}
diff --git a/emscripten/third_party/libresample/tests/resample-sndfile.c b/emscripten/third_party/libresample/tests/resample-sndfile.c
new file mode 100644
index 0000000..99133b4
--- /dev/null
+++ b/emscripten/third_party/libresample/tests/resample-sndfile.c
@@ -0,0 +1,213 @@
+/**********************************************************************
+
+  resample-sndfile.c
+
+  Written by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+**********************************************************************/
+
+#include "../include/libresample.h"
+
+#include <sndfile.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include <sys/time.h>
+
+#define MIN(A, B) (A) < (B)? (A) : (B)
+
+void usage(char *progname)
+{
+   fprintf(stderr, "Usage: %s -by <ratio> <input> <output>\n", progname);
+   fprintf(stderr, "       %s -to <rate> <input> <output>\n", progname);
+   fprintf(stderr, "\n");
+   exit(-1);
+}
+
+int main(int argc, char **argv)
+{
+   SNDFILE *srcfile, *dstfile;
+   SF_INFO srcinfo, dstinfo;
+   SF_FORMAT_INFO formatinfo;
+   char *extension;
+   void **handle;
+   int channels;
+   int srclen, dstlen;
+   float *src, *srci;
+   float *dst, *dsti;
+   double ratio = 0.0;
+   double srcrate;
+   double dstrate = 0.0;
+   struct timeval tv0, tv1;
+   double deltat;
+   int numformats;
+   int pos, bufferpos, outcount;
+   int i, c;
+
+   if (argc != 5)
+      usage(argv[0]);
+
+   if (!strcmp(argv[1], "-by")) {
+      ratio = atof(argv[2]);
+      if (ratio <= 0.0) {
+         fprintf(stderr, "Ratio of %f is illegal\n", ratio);
+         usage(argv[0]);
+      }
+   }
+   else if (!strcmp(argv[1], "-to")) {
+      dstrate = atof(argv[2]);
+      if (dstrate < 10.0 || dstrate > 100000.0) {
+         fprintf(stderr, "Sample rate of %f is illegal\n", dstrate);
+         usage(argv[0]);
+      }
+   }
+   else
+      usage(argv[0]);
+
+   memset(&srcinfo, 0, sizeof(srcinfo));
+   memset(&dstinfo, 0, sizeof(dstinfo));
+   srcfile = sf_open(argv[3], SFM_READ, &srcinfo);
+   if (!srcfile) {
+      fprintf(stderr, "%s", sf_strerror(NULL));
+      exit(-1);
+   }
+
+   srcrate = srcinfo.samplerate;
+   if (dstrate == 0.0)
+      dstrate = srcrate * ratio;
+   else
+      ratio = dstrate / srcrate;
+
+   channels = srcinfo.channels;
+
+   /* figure out format of destination file */
+
+   extension = strstr(argv[4], ".");
+   if (extension) {
+      extension++;
+      sf_command(NULL, SFC_GET_FORMAT_MAJOR_COUNT,
+                 &numformats, sizeof(numformats));
+      for(i=0; i<numformats; i++) {
+         memset(&formatinfo, 0, sizeof(formatinfo));
+         formatinfo.format = i;
+         sf_command(NULL, SFC_GET_FORMAT_MAJOR,
+                    &formatinfo, sizeof(formatinfo));
+         if (!strcmp(formatinfo.extension, extension)) {
+            printf("Using %s for output format.\n", formatinfo.name);
+            dstinfo.format = formatinfo.format |
+               (srcinfo.format & SF_FORMAT_SUBMASK);
+            break;
+         }            
+      }
+   }
+
+   if (!dstinfo.format) {
+      if (extension)
+         printf("Warning: output format (%s) not recognized, "
+                "using same as input format.\n",
+                extension);
+      dstinfo.format = srcinfo.format;
+   }
+
+   dstinfo.samplerate = (int)(dstrate + 0.5);
+   dstinfo.channels = channels;
+
+   dstfile = sf_open(argv[4], SFM_WRITE, &dstinfo);
+   if (!dstfile) {
+      fprintf(stderr, "%s", sf_strerror(NULL));
+      exit(-1);
+   }
+
+   printf("Source: %s (%d frames, %.2f Hz)\n",
+          argv[3], (int)srcinfo.frames, srcrate);
+   printf("Destination: %s (%.2f Hz, ratio=%.5f)\n", argv[4],
+          dstrate, ratio);
+
+   srclen = 4096;
+   dstlen = (srclen * ratio + 1000);
+   srci = (float *)malloc(srclen * channels * sizeof(float));
+   dsti = (float *)malloc(dstlen * channels * sizeof(float));
+   src = (float *)malloc(srclen * sizeof(float));
+   dst = (float *)malloc(dstlen * sizeof(float));
+
+   handle = (void **)malloc(channels * sizeof(void *));
+   for(c=0; c<channels; c++)
+      handle[c] = resample_open(1, ratio, ratio);
+
+   gettimeofday(&tv0, NULL);
+
+   pos = 0;
+   bufferpos = 0;
+   outcount = 0;
+   while(pos < srcinfo.frames) {
+      int block = MIN(srclen-bufferpos, srcinfo.frames-pos);
+      int lastFlag = (pos+block == srcinfo.frames);
+      int inUsed, inUsed2=0, out=0, out2=0;
+
+      sf_readf_float(srcfile, &srci[bufferpos*channels], block);
+      block += bufferpos;
+
+      for(c=0; c<channels; c++) {
+         for(i=0; i<block; i++)
+            src[i] = srci[i*channels+c];
+
+         inUsed = 0;
+         out = resample_process(handle[c], ratio, src, block, lastFlag,
+                                &inUsed, dst, dstlen);
+         if (c==0) {
+            inUsed2 = inUsed;
+            out2 = out;
+         }
+         else {
+            if (inUsed2 != inUsed || out2 != out) {
+               fprintf(stderr, "Fatal error: channels out of sync!\n");
+               exit(-1);
+            }
+         }
+
+         for(i=0; i<out; i++)
+	 {
+	    if(dst[i] <= -1)
+	       dsti[i*channels+c] = -1;
+	    else if(dst[i] >= 1)
+	       dsti[i*channels+c] = 1;
+	    else
+	       dsti[i*channels+c] = dst[i];
+	 }
+      }
+
+      sf_writef_float(dstfile, dsti, out);
+
+      bufferpos = block - inUsed;
+      for(i=0; i<bufferpos*channels; i++)
+         srci[i] = srci[i+(inUsed*channels)];
+      pos += inUsed;
+      outcount += out;
+   }
+
+   sf_close(srcfile);
+   sf_close(dstfile);
+
+   gettimeofday(&tv1, NULL);
+   deltat =
+      (tv1.tv_sec + tv1.tv_usec * 0.000001) -
+      (tv0.tv_sec + tv0.tv_usec * 0.000001);
+
+   printf("Elapsed time: %.3f seconds\n", deltat);
+   printf("%d frames written to output file\n", outcount);
+
+   free(src);
+   free(srci);
+   free(dst);
+   free(dsti);
+
+   exit(0);
+}
diff --git a/emscripten/third_party/libresample/tests/testresample.c b/emscripten/third_party/libresample/tests/testresample.c
new file mode 100644
index 0000000..aa83a46
--- /dev/null
+++ b/emscripten/third_party/libresample/tests/testresample.c
@@ -0,0 +1,182 @@
+/**********************************************************************
+
+  testresample.c
+
+  Real-time library interface by Dominic Mazzoni
+
+  Based on resample-1.7:
+    http://www-ccrma.stanford.edu/~jos/resample/
+
+  Dual-licensed as LGPL and BSD; see README.md and LICENSE* files.
+
+**********************************************************************/
+
+#include "../include/libresample.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define MIN(A, B) (A) < (B)? (A) : (B)
+
+void runtest(int srclen, double freq, double factor,
+             int srcblocksize, int dstblocksize)
+{
+   int expectedlen = (int)(srclen * factor);
+   int dstlen = expectedlen + 1000;
+   float *src = (float *)malloc((srclen+100) * sizeof(float));
+   float *dst = (float *)malloc((dstlen+100) * sizeof(float));
+   void *handle;
+   double sum, sumsq, err, rmserr;
+   int i, out, o, srcused, errcount, rangecount;
+   int statlen, srcpos, lendiff;
+   int fwidth;
+
+   printf("-- srclen: %d sin freq: %.1f factor: %.3f srcblk: %d dstblk: %d\n",
+          srclen, freq, factor, srcblocksize, dstblocksize);
+
+   for(i=0; i<srclen; i++)
+      src[i] = sin(i/freq);
+   for(i=srclen; i<srclen+100; i++)
+      src[i] = -99.0;
+
+   for(i=0; i<dstlen+100; i++)
+      dst[i] = -99.0;
+
+   handle = resample_open(1, factor, factor);
+   fwidth = resample_get_filter_width(handle);
+   out = 0;
+   srcpos = 0;
+   for(;;) {
+      int srcBlock = MIN(srclen-srcpos, srcblocksize);
+      int lastFlag = (srcBlock == srclen-srcpos);
+
+      o = resample_process(handle, factor,
+                           &src[srcpos], srcBlock,
+                           lastFlag, &srcused,
+                           &dst[out], MIN(dstlen-out, dstblocksize));
+      srcpos += srcused;
+      if (o >= 0)
+         out += o;
+      if (o < 0 || (o == 0 && srcpos == srclen))
+         break;
+   }
+   resample_close(handle);
+
+   if (o < 0) {
+      printf("Error: resample_process returned an error: %d\n", o);
+   }
+
+   if (out <= 0) {
+      printf("Error: resample_process returned %d samples\n", out);
+      free(src);
+      free(dst);
+      return;
+   }
+
+   lendiff = abs(out - expectedlen);
+   if (lendiff > (int)(2*factor + 1.0)) {
+      printf("   Expected ~%d, got %d samples out\n",
+             expectedlen, out);
+   }
+   
+   sum = 0.0;
+   sumsq = 0.0;
+   errcount = 0.0;
+
+   /* Don't compute statistics on all output values; the last few
+      are guaranteed to be off because it's based on far less
+      interpolation. */
+   statlen = out - fwidth;
+
+   for(i=0; i<statlen; i++) {
+      double diff = sin((i/freq)/factor) - dst[i];
+      if (fabs(diff) > 0.05) {
+         if (errcount == 0)
+            printf("   First error at i=%d: expected %.3f, got %.3f\n",
+                   i, sin((i/freq)/factor), dst[i]);
+         errcount++;
+      }
+      sum += fabs(diff);
+      sumsq += diff * diff;
+   }
+
+   rangecount = 0;
+   for(i=0; i<statlen; i++) {
+      if (dst[i] < -1.01 || dst[i] > 1.01) {
+         if (rangecount == 0)
+            printf("   Error at i=%d: value is %.3f\n", i, dst[i]);
+         rangecount++;
+      }
+   }
+   if (rangecount > 1)
+      printf("   At least %d samples were out of range\n", rangecount);
+
+   if (errcount > 0) {
+      i = out - 1;
+      printf("   i=%d:  expected %.3f, got %.3f\n",
+             i, sin((i/freq)/factor), dst[i]);
+      printf("   At least %d samples had significant error.\n", errcount);
+   }
+   err = sum / statlen;
+   rmserr = sqrt(sumsq / statlen);
+   printf("   Out: %d samples  Avg err: %f RMS err: %f\n", out, err, rmserr);
+   free(src);
+   free(dst);
+}
+
+int main(int argc, char **argv)
+{
+   int i, srclen, dstlen, ifreq;
+   double factor;
+
+   printf("\n*** Vary source block size*** \n\n");
+   srclen = 10000;
+   ifreq = 100;
+   for(i=0; i<20; i++) {
+      factor = ((rand() % 16) + 1) / 4.0;
+      dstlen = (int)(srclen * factor + 10);
+      runtest(srclen, (double)ifreq, factor, 64, dstlen);
+      runtest(srclen, (double)ifreq, factor, 32, dstlen);
+      runtest(srclen, (double)ifreq, factor, 8, dstlen);
+      runtest(srclen, (double)ifreq, factor, 2, dstlen);
+      runtest(srclen, (double)ifreq, factor, srclen, dstlen);
+   }
+
+   printf("\n*** Vary dest block size ***\n\n");
+   srclen = 10000;
+   ifreq = 100;
+   for(i=0; i<20; i++) {
+      factor = ((rand() % 16) + 1) / 4.0;
+      runtest(srclen, (double)ifreq, factor, srclen, 32);
+      dstlen = (int)(srclen * factor + 10);
+      runtest(srclen, (double)ifreq, factor, srclen, dstlen);
+   }
+
+   printf("\n*** Resample factor 1.0, testing different srclen ***\n\n");
+   ifreq = 40;
+   for(i=0; i<100; i++) {
+      srclen = (rand() % 30000) + 10;
+      dstlen = (int)(srclen + 10);
+      runtest(srclen, (double)ifreq, 1.0, srclen, dstlen);
+   }
+
+   printf("\n*** Resample factor 1.0, testing different sin freq ***\n\n");
+   srclen = 10000;
+   for(i=0; i<100; i++) {
+      ifreq = ((int)rand() % 10000) + 1;
+      dstlen = (int)(srclen * 10);
+      runtest(srclen, (double)ifreq, 1.0, srclen, dstlen);
+   }
+
+   printf("\n*** Resample with different factors ***\n\n");
+   srclen = 10000;
+   ifreq = 100;
+   for(i=0; i<100; i++) {
+      factor = ((rand() % 64) + 1) / 4.0;
+      dstlen = (int)(srclen * factor + 10);
+      runtest(srclen, (double)ifreq, factor, srclen, dstlen);
+   }
+
+   return 0;
+}
diff --git a/emscripten/third_party/libresample/win/libresample.vcproj b/emscripten/third_party/libresample/win/libresample.vcproj
new file mode 100644
index 0000000..5a74163
--- /dev/null
+++ b/emscripten/third_party/libresample/win/libresample.vcproj
@@ -0,0 +1,776 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="libresample"

+	ProjectGUID="{F00717F2-67C8-44E1-AF00-541DFA9CB7F2}"

+	RootNamespace="libresample"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory=".\$(ConfigurationName)"

+			IntermediateDirectory=".\$(ConfigurationName)"

+			ConfigurationType="4"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=".\$(ConfigurationName)/libresample.pch"

+				AssemblerListingLocation=".\$(ConfigurationName)/"

+				ObjectFile=".\$(ConfigurationName)/"

+				ProgramDataBaseFileName=".\$(ConfigurationName)/"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DebugInformationFormat="4"

+				DisableSpecificWarnings="4996"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="libresampled.lib"

+				SuppressStartupBanner="true"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory=".\$(ConfigurationName)"

+			IntermediateDirectory=".\$(ConfigurationName)"

+			ConfigurationType="4"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalOptions="/O2"

+				Optimization="2"

+				InlineFunctionExpansion="1"

+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"

+				StringPooling="true"

+				RuntimeLibrary="0"

+				EnableFunctionLevelLinking="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=".\$(ConfigurationName)/libresample.pch"

+				AssemblerListingLocation=".\$(ConfigurationName)/"

+				ObjectFile=".\$(ConfigurationName)/"

+				ProgramDataBaseFileName=".\$(ConfigurationName)/"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DisableSpecificWarnings="4996"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="libresample.lib"

+				SuppressStartupBanner="true"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Unicode_Debug|Win32"

+			OutputDirectory="$(ConfigurationName)"

+			IntermediateDirectory="$(ConfigurationName)"

+			ConfigurationType="4"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=".\$(ConfigurationName)/libresample.pch"

+				AssemblerListingLocation=".\$(ConfigurationName)/"

+				ObjectFile=".\$(ConfigurationName)/"

+				ProgramDataBaseFileName=".\$(ConfigurationName)/"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DebugInformationFormat="4"

+				DisableSpecificWarnings="4996"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="libresampleud.lib"

+				SuppressStartupBanner="true"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Unicode_Release|Win32"

+			OutputDirectory="$(ConfigurationName)"

+			IntermediateDirectory="$(ConfigurationName)"

+			ConfigurationType="4"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalOptions="/O2"

+				Optimization="2"

+				InlineFunctionExpansion="1"

+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"

+				StringPooling="true"

+				RuntimeLibrary="0"

+				EnableFunctionLevelLinking="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=".\$(ConfigurationName)/libresample.pch"

+				AssemblerListingLocation=".\$(ConfigurationName)/"

+				ObjectFile=".\$(ConfigurationName)/"

+				ProgramDataBaseFileName=".\$(ConfigurationName)/"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DisableSpecificWarnings="4996"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="libresampleu.lib"

+				SuppressStartupBanner="true"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug DLL|Win32"

+			OutputDirectory="$(ConfigurationName)"

+			IntermediateDirectory="$(ConfigurationName)"

+			ConfigurationType="4"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="3"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=".\$(ConfigurationName)/libresample.pch"

+				AssemblerListingLocation=".\$(ConfigurationName)/"

+				ObjectFile=".\$(ConfigurationName)/"

+				ProgramDataBaseFileName=".\$(ConfigurationName)/"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DebugInformationFormat="4"

+				DisableSpecificWarnings="4996"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="libresampled.lib"

+				SuppressStartupBanner="true"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug wx284|Win32"

+			OutputDirectory="$(ConfigurationName)"

+			IntermediateDirectory="$(ConfigurationName)"

+			ConfigurationType="4"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="3"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=".\$(ConfigurationName)/libresample.pch"

+				AssemblerListingLocation=".\$(ConfigurationName)/"

+				ObjectFile=".\$(ConfigurationName)/"

+				ProgramDataBaseFileName=".\$(ConfigurationName)/"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DebugInformationFormat="4"

+				DisableSpecificWarnings="4996"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="libresampled.lib"

+				SuppressStartupBanner="true"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Modular_Release|Win32"

+			OutputDirectory="$(ConfigurationName)"

+			IntermediateDirectory="$(ConfigurationName)"

+			ConfigurationType="4"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalOptions="/O2"

+				Optimization="2"

+				InlineFunctionExpansion="1"

+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"

+				StringPooling="true"

+				RuntimeLibrary="2"

+				EnableFunctionLevelLinking="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=".\$(ConfigurationName)/libresample.pch"

+				AssemblerListingLocation=".\$(ConfigurationName)/"

+				ObjectFile=".\$(ConfigurationName)/"

+				ProgramDataBaseFileName=".\$(ConfigurationName)/"

+				WarningLevel="3"

+				SuppressStartupBanner="true"

+				DisableSpecificWarnings="4996"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="libresample.lib"

+				SuppressStartupBanner="true"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

+			>

+			<File

+				RelativePath="..\src\filterkit.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Unicode_Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Unicode_Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug DLL|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug wx284|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Modular_Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\src\resample.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Unicode_Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Unicode_Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug DLL|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug wx284|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Modular_Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\src\resamplesubs.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Unicode_Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Unicode_Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug DLL|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug wx284|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						BasicRuntimeChecks="3"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Modular_Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl"

+			>

+			<File

+				RelativePath="..\src\filterkit.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\libresample.h"

+				>

+			</File>

+			<File

+				RelativePath="..\src\resample_defs.h"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>