https://www.lauriemallon.com/wp-content/plugins/S3MediaVaultPro/includes/javascript/recordmic_lib.js
1var justMicRec={config:{hostPath:recordMicScript.s3mvRootURL+"/recordMicAjax.php",workerPath:recordMicScript.s3mvJSDirURL+"recordmic_worker.js",recordingError:function(a){alert(a)},recordingActivity:function(a,b){},recordingStopped:function(){},uploadingProcess:function(a,b){},WAVsendingFinished:function(){},callback:function(){}},player:new Audio,activeId:null,secs:0,tensecs:0,context:null,node:null,analyserNode:null,worker:null,blob:null,recording:!1,callback:null,configure:function(a){for(var b in a)this.config[b]= 2a[b]},init:function(a){var b=this.config.bufferLen||4096;this.context=a.context;this.node=this.context.createScriptProcessor?this.context.createScriptProcessor(b,2,2):this.context.createJavaScriptNode(b,2,2);this.analyserNode=this.context.createAnalyser();this.analyserNode.smoothingTimeConstant=.3;a.connect(this.analyserNode);this.analyserNode.connect(this.node);this.node.connect(this.context.destination);this.node.onaudioprocess=function(c){justMicRec.recording&&justMicRec.worker.postMessage({command:"record", 3buffer:[c.inputBuffer.getChannelData(0),c.inputBuffer.getChannelData(1)]})};this.worker=new Worker(this.config.workerPath);this.worker.onmessage=function(c){justMicRec.callback(c.data)};this.worker.postMessage({command:"init",config:{sampleRate:this.context.sampleRate}});this.start(this.secs)},start:function(a){this.secs=a||60;1>this.secs&&(this.secs=60);this.tensecs=0;this.context?(this.clear(),this.recording=!0,this.activeId=setInterval(this.recActivity,100)):this.initMic()},resume:function(){!this.context|| 40>=this.secs?this.config.recordingStopped():(this.recording=!0,this.activeId=setInterval(this.recActivity,100))},stop:function(){clearInterval(this.activeId);this.recording=!1;this.exportMonoWAV(this.doneWAVEncoding)},clear:function(){this.worker.postMessage({command:"clear"});this.blob=null},recActivity:function(){0==++justMicRec.tensecs%10&&--justMicRec.secs;0>=justMicRec.secs&&justMicRec.stop();justMicRec.config.recordingActivity(justMicRec.analyserNode,justMicRec.secs)},exportWAV:function(a){this.callback= 5a||this.config.callback;this.worker.postMessage({command:"exportWAV",type:"audio/wav"})},exportMonoWAV:function(a){this.callback=a||this.config.callback;this.worker.postMessage({command:"exportMonoWAV",type:"audio/wav"})},doneWAVEncoding:function(a){justMicRec.blob=a;justMicRec.player.src=(window.URL||window.webkitURL).createObjectURL(a);justMicRec.config.recordingStopped()},getWAVsize:function(){return this.blob&&this.blob.size?this.blob.size:0},preview:function(){this.player.play()},stoppreview:function(){this.player.pause(); 6this.player.currentTime=0},sendWAV:function(){this.blob?this.uploadRecording(this.blob):this.config.recordingError("The recording is not ready yet")},uploadRecording:function(a){var b=new XMLHttpRequest,c=null!=b.upload?b.upload:b,d,e={Accept:"text/plain","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};b.open("POST",this.config.hostPath,!0);c.onprogress=function(f){justMicRec.config.uploadingProcess(f.loaded,f.total)};b.onload=b.onerror=function(){200==this.status&&4==this.readyState&& 7"ok"==this.responseText?justMicRec.config.WAVsendingFinished():justMicRec.config.recordingError(this.responseText)};for(d in e)b.setRequestHeader(d,e[d]);b.send(a)},gotStream:function(a){window.AudioContext=window.AudioContext||window.webkitAudioContext;justMicRec.init((new window.AudioContext).createMediaStreamSource(a))},initMic:function(){var a={audio:{mandatory:{googEchoCancellation:"false",googAutoGainControl:"false",googNoiseSuppression:"false",googHighpassFilter:"false"},optional:[]},video:!1}, 8b=navigator.getUserMedia||navigator.webKitGetUserMedia||navigator.moxGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(a).then(this.gotStream)["catch"](function(c){justMicRec.config.recordingError(c)}):b?b(a,this.gotStream,function(c){justMicRec.config.recordingError(c)}):this.config.recordingError("This browser does not support getUserMedia")},UAhasUserMedia:function(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia|| 9navigator.getUserMedia||navigator.webKitGetUserMedia||navigator.moxGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)}};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.