/* 录音 https://github.com/xiangyuecn/Recorder src: recorder-core.js */ !function(x){"use strict";var d=function(){},U=function(e){return new t(e)};U.LM="2022-08-06 20:51";var A="Recorder",S="getUserMedia",P="srcSampleRate",E="sampleRate";U.IsOpen=function(){var e=U.Stream;if(e){var t=e.getTracks&&e.getTracks()||e.audioTracks||[],r=t[0];if(r){var n=r.readyState;return"live"==n||n==r.LIVE}}return!1},U.BufferSize=4096,U.Destroy=function(){for(var e in z(A+" Destroy"),y(),r)r[e]()};var r={};U.BindDestroy=function(e,t){r[e]=t},U.Support=function(){var e=x.AudioContext;if(e||(e=x.webkitAudioContext),!e)return!1;var t=navigator.mediaDevices||{};return t[S]||(t=navigator)[S]||(t[S]=t.webkitGetUserMedia||t.mozGetUserMedia||t.msGetUserMedia),!!t[S]&&(U.Scope=t,U.Ctx&&"closed"!=U.Ctx.state||(U.Ctx=new e,U.BindDestroy("Ctx",function(){var e=U.Ctx;e&&e.close&&(e.close(),U.Ctx=0)})),!0)};var L="ConnectEnableWebM";U[L]=!0;var T="ConnectEnableWorklet";U[T]=!1;var _=function(e,c){var f,i,u,l=e.BufferSize||U.BufferSize,v=U.Ctx,p=e.Stream,s=function(e){var t=p._m=v.createMediaStreamSource(p),r=v.destination,n="createMediaStreamDestination";v[n]&&(r=v[n]()),t.connect(e),e.connect(r)},h="",g=p._call,m=function(e){for(var t in g){for(var r=e.length,n=new Int16Array(r),a=0,o=0;o"+f,3);for(var u=0,l=o;l"+d.length+" 花:"+(Date.now()-n)+"ms"),setTimeout(function(){n=Date.now(),a[o.type](d,function(e){u(e,g)},function(e){f(e)})})}else f("未加载"+o.type+"编码器");else f("音频buffers被释放");else f("未采集到录音")}},x[A]&&(z("重复引入"+A,3),x[A].Destroy()),x[A]=U;var F=function(e,t){t.pos||(t.pos=[0],t.tracks={},t.bytes=[]);var r=t.tracks,n=[t.pos[0]],a=function(){t.pos[0]=n[0]},o=t.bytes.length,i=new Uint8Array(o+e.length);if(i.set(t.bytes),i.set(e,o),t.bytes=i,!t._ht){if(B(i,n),N(i,n),!R(B(i,n),[24,83,128,103]))return;for(B(i,n);n[0]=e.length)){var a=e[n],o=("0000000"+a.toString(2)).substr(-8),i=/^(0*1)(\d*)$/.exec(o);if(i){var s=i[1].length,c=[];if(!(n+s>e.length)){for(var f=0;fe.length)return;for(var i=0;i