diff --git "a/static/js/recorder.mp3.min.js" "b/static/js/recorder.mp3.min.js" deleted file mode 100755--- "a/static/js/recorder.mp3.min.js" +++ /dev/null @@ -1,6 +0,0 @@ -/* -录音 -https://github.com/xiangyuecn/Recorder -src: recorder-core.js,engine/mp3.js,engine/mp3-engine.js -*/ -!function(k){"use strict";var S=function(){},O=function(e){return new t(e)};O.LM="2023-07-01 20:46";var x="Recorder",M="getUserMedia",V="srcSampleRate",N="sampleRate",y="catch";O.IsOpen=function(){var e=O.Stream;if(e){var t=e.getTracks&&e.getTracks()||e.audioTracks||[],a=t[0];if(a){var s=a.readyState;return"live"==s||s==a.LIVE}}return!1},O.BufferSize=4096,O.Destroy=function(){for(var e in C(x+" Destroy"),A(),a)a[e]()};var a={};O.BindDestroy=function(e,t){a[e]=t},O.Support=function(){var e=navigator.mediaDevices||{};return e[M]||(e=navigator)[M]||(e[M]=e.webkitGetUserMedia||e.mozGetUserMedia||e.msGetUserMedia),!!e[M]&&(O.Scope=e,!!O.GetContext())},O.GetContext=function(e){var t=k.AudioContext;if(t||(t=k.webkitAudioContext),!t)return null;var a=O.Ctx;if(a&&"closed"!=a.state||(a=O.Ctx=new t,O.NewCtxs=O.NewCtxs||[],O.BindDestroy("Ctx",function(){var e=O.Ctx;e&&e.close&&(e.close(),O.Ctx=0);var t=O.NewCtxs;O.NewCtxs=[];for(var a=0;a"+u,3);for(var m=0,p=i;p"+v.length+" 花:"+(Date.now()-s)+"ms"),setTimeout(function(){s=Date.now(),n[r.type](v,function(e){f(e,p)},function(e){l(e)})})}else l("未加载"+r.type+"编码器");else l("音频buffers被释放");else l("未采集到录音")}},k[x]&&(C("重复引入"+x,3),k[x].Destroy()),k[x]=O;var I=function(e,t){t.pos||(t.pos=[0],t.tracks={},t.bytes=[]);var a=t.tracks,s=[t.pos[0]],n=function(){t.pos[0]=s[0]},r=t.bytes.length,i=new Uint8Array(r+e.length);if(i.set(t.bytes),i.set(e,r),t.bytes=i,!t._ht){if(D(i,s),Y(i,s),!L(D(i,s),[24,83,128,103]))return;for(D(i,s);s[0]=e.length)){var n=e[s],r=("0000000"+n.toString(2)).substr(-8),i=/^(0*1)(\d*)$/.exec(r);if(i){var o=i[1].length,_=[];if(!(s+o>e.length)){for(var l=0;le.length)return;for(var i=0;i=c.byteLength?(o-=c.byteLength,l.push(c),e.splice(f,1),f--):(e[f]=c.slice(o),_=c,o=0)}if(!this.rm(e,t)){_&&(e[0]=_);for(f=0;f "+s.duration+"ms",2>=1;0!=e--;)n[r++]=i>a[s++]?0:1,n[r++]=i>a[s++]?0:1}function R(e,t,a,s,n,r){var i=(e>>=1)%2;for(e>>=1;0!=e--;){var o,_,l,f,c,h,u,m;o=a[s++]*t,_=a[s++]*t,c=0|o,l=a[s++]*t,h=0|_,f=a[s++]*t,u=0|l,o+=M.adj43[c],m=0|f,_+=M.adj43[h],n[r++]=0|o,l+=M.adj43[u],n[r++]=0|_,f+=M.adj43[m],n[r++]=0|l,n[r++]=0|f}0!=i&&(c=0|(o=a[s++]*t),h=0|(_=a[s++]*t),o+=M.adj43[c],_+=M.adj43[h],n[r++]=0|o,n[r++]=0|_)}var o=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function d(e,t,a,s){var n=function(e,t,a){var s=0,n=0;do{var r=e[t++],i=e[t++];s>=16)&&(o=r,s++),n.bits+=o,s}(e,t,a,o[n-1],s);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,a,s,n){var r=0,i=0,o=0,_=F.ht[s].xlen,l=F.ht[s].hlen,f=F.ht[s+1].hlen,c=F.ht[s+2].hlen;do{var h=e[t+0]*_+e[t+1];t+=2,r+=l[h],i+=f[h],o+=c[h]}while(t=n);r++);for(i=r-8;i<24&&!(F.ht[i].linmax>=n);i++);return function(e,t,a,s,n,r){var i,o=65536*F.ht[s].xlen+F.ht[n].xlen,_=0;do{var l=e[t++],f=e[t++];0!=l&&(14>=16)&&(_=i,s=n),r.bits+=_,s}(e,t,a,i,r,s)}}function u(e,t,a,s,n,r,i,o){for(var _=t.big_values,l=2;l>1<<1);for(null!=a&&(a.sfb_count1=0);1t.big_values&&(r=t.big_values),i=t.big_values;else if(t.block_type==Pe.NORM_TYPE){if(r=t.region0_count=e.bv_scf[n-2],i=t.region1_count=e.bv_scf[n-1],i=e.scalefac_band.l[r+i+2],r=e.scalefac_band.l[r+1],ir)return T.LARGE_BITS;if(function(e,t,a,s,n){var r,i,o,_=0,l=0,f=0,c=0,h=t,u=0,m=h,p=0,b=e,v=0;for(o=null!=n&&s.global_gain==n.global_gain,i=s.block_type==Pe.SHORT_TYPE?38:21,r=0;r<=i;r++){var d=-1;if((o||s.block_type==Pe.NORM_TYPE)&&(d=s.global_gain-(s.scalefac[r]+(0!=s.preflag?M.pretab[r]:0)<s.max_nonzero_coeff&&(g=s.max_nonzero_coeff-_+1,xe.fill(t,s.max_nonzero_coeff,576,0),(S=g)<0&&(S=0),r=i+1),0==l&&0==f&&(m=h,p=u,b=e,v=c),null!=n&&0=n.sfb_count1&&0=n.step[r]?(0!=l&&(R(l,a,b,v,m,p),l=0,m=h,p=u,b=e,v=c),f+=S):(0!=f&&(w(f,a,b,v,m,p),f=0,m=h,p=u,b=e,v=c),l+=S),S<=0){0!=f&&(w(f,a,b,v,m,p),f=0),0!=l&&(R(l,a,b,v,m,p),l=0);break}}r<=i&&(u+=s.width[r],c+=s.width[r],_+=s.width[r])}0!=l&&(R(l,a,b,v,m,p),l=0),0!=f&&(w(f,a,b,v,m,p),f=0)}(t,n,M.IPOW20(a.global_gain),a,s),0!=(2&e.substep_shaping))for(var i=0,o=a.global_gain+a.scalefac_scale,_=.634521682242439/M.IPOW20(o),l=0;l=_?n[f]:0}return this.noquant_count_bits(e,a,s)},this.best_huffman_divide=function(e,t){var a=new y,s=t.l3_enc,n=Ae(23),r=Ae(23),i=Ae(23),o=Ae(23);if(t.block_type!=Pe.SHORT_TYPE||1!=e.mode_gr){a.assign(t),t.block_type==Pe.NORM_TYPE&&(!function(e,t,a,s,n,r,i){for(var o=t.big_values,_=0;_<=22;_++)s[_]=T.LARGE_BITS;for(_=0;_<16;_++){var l=e.scalefac_band.l[_+1];if(o<=l)break;var f=0,c=new v(f),h=d(a,0,l,c);f=c.bits;for(var u=0;u<8;u++){var m=e.scalefac_band.l[_+u+2];if(o<=m)break;var p=f,b=d(a,l,m,c=new v(p));p=c.bits,s[_+u]>p&&(s[_+u]=p,r[(n[_+u]=_)+u]=h,i[_+u]=b)}}}(e,t,s,n,r,i,o),u(e,a,t,s,n,r,i,o));var _=a.big_values;if(!(0==_||1<(s[_-2]|s[_-1])||576<(_=t.count1+2))){a.assign(t),a.count1=_;for(var l=0,f=0;_>a.big_values;_-=4){var c=2*(2*(2*s[_-4]+s[_-3])+s[_-2])+s[_-1];l+=F.t32l[c],f+=F.t33l[c]}if(a.big_values=_,a.count1table_select=0,fa.part2_3_length&&t.assign(a)}}}};var h=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],m=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],p=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],b=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];k.slen1_tab=p,k.slen2_tab=b,this.best_scalefac_store=function(e,t,a,s){var n,r,i,o,_=s.tt[t][a],l=0;for(n=i=0;n<_.sfbmax;n++){var f=_.width[n];for(i+=f,o=-f;o<0&&0==_.l3_enc[o+i];o++);0==o&&(_.scalefac[n]=l=-2)}if(0==_.scalefac_scale&&0==_.preflag){var c=0;for(n=0;n<_.sfbmax;n++)0<_.scalefac[n]&&(c|=_.scalefac[n]);if(0==(1&c)&&0!=c){for(n=0;n<_.sfbmax;n++)0<_.scalefac[n]&&(_.scalefac[n]>>=1);_.scalefac_scale=l=1}}if(0==_.preflag&&_.block_type!=Pe.SHORT_TYPE&&2==e.mode_gr){for(n=11;nf&&(s.part2_length=f,s.scalefac_compress=r)}}(a,s),l=0),n=0;n<_.sfbmax;n++)-2==_.scalefac[n]&&(_.scalefac[n]=0);0!=l&&(2==e.mode_gr?this.scale_bitcount(_):this.scale_bitcount_lsf(e,_))};var _=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],l=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],f=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(e){var t,a,s,n=0,r=0,i=e.scalefac;if(e.block_type==Pe.SHORT_TYPE)s=_,0!=e.mixed_block_flag&&(s=l);else if(s=f,0==e.preflag){for(a=11;as[t]&&(e.part2_length=s[t],e.scalefac_compress=t);return e.part2_length==T.LARGE_BITS};var g=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(e,t){var a,s,n,r,i,o,_,l,f=Ae(4),c=t.scalefac;for(a=0!=t.preflag?2:0,_=0;_<4;_++)f[_]=0;if(t.block_type==Pe.SHORT_TYPE){s=1;var h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n]/3,_=0;_f[n]&&(f[n]=c[3*l+i])}else{s=0;h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n],_=0;_f[n]&&(f[n]=c[l])}for(o=!1,n=0;n<4;n++)f[n]>g[a][n]&&(o=!0);if(!o){var u,m,p,b;for(t.sfb_partition_table=M.nr_of_sfb_block[a][s],n=0;n<4;n++)t.slen[n]=S[f[n]];switch(u=t.slen[0],m=t.slen[1],p=t.slen[2],b=t.slen[3],a){case 0:t.scalefac_compress=(5*u+m<<4)+(p<<2)+b;break;case 1:t.scalefac_compress=400+(5*u+m<<2)+p;break;case 2:t.scalefac_compress=500+3*u+m;break;default:$.err.printf("intensity stereo not implemented yet\n")}}if(!o)for(n=t.part2_length=0;n<4;n++)t.part2_length+=t.slen[n]*t.sfb_partition_table[n];return o};var S=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var a,s=0;e.scalefac_band.l[++s]t;)a--;for(a<0&&(a=n[s][0]),e.bv_scf[t-2]=a,a=n[s][1];e.scalefac_band.l[a+e.bv_scf[t-2]+2]>t;)a--;a<0&&(a=n[s][1]),e.bv_scf[t-1]=a}}}function X(){}function M(){this.setModules=function(e,t,a){e,t,a};var o=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];this.updateMusicCRC=function(e,t,a,s){for(var n=0;n>8^o[255&(i^r)]);var r,i}}function q(){var _=this,s=32773,c=null,h=null,r=null,u=null;this.setModules=function(e,t,a,s){c=e,h=t,r=a,u=s};var m=null,l=0,p=0,b=0;function v(e,t,a){for(;0>a<>a<>3]|=t>>a<<8-(7&s)-n,s+=n}e.header[e.h_ptr].ptr=s}function n(e,t){e<<=8;for(var a=0;a<8;a++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=s);return t}function d(e,t){var a,s=F.ht[t.count1table_select+32],n=0,r=t.big_values,i=t.big_values;for(a=(t.count1-t.big_values)/4;0t.big_values&&(a=t.big_values);var s=g(e,t.table_select[0],0,a,t);return s+=g(e,t.table_select[1],a,t.big_values,t)}function M(e,t){var a,s,n,r;a=t.big_values;var i=t.region0_count+1;return n=e.scalefac_band.l[i],i+=t.region1_count+1,a>8),t[5]=byte(255&a)},this.flush_bitstream=function(e){var t,a,s=e.internal_flags,n=s.h_ptr-1;if(-1==n&&(n=G.MAX_HEADER_BUF-1),t=s.l3_side,!((a=R(e,new w))<0)){if(o(e,a),s.ResvSize=0,t.main_data_begin=0,s.findReplayGain){var r=c.GetTitleGain(s.rgdata);s.RadioGain=0|Math.floor(10*r+.5)}s.findPeakSample&&(s.noclipGainChange=0|Math.ceil(20*B(s.PeakSample/32767)*10),0 ResvSize"),8*t.main_data_begin!=a.ResvSize&&($.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n",8*t.main_data_begin,a.ResvSize,t.resvDrain_post,t.resvDrain_pre,8*a.sideinfo_len,n-t.resvDrain_post-8*a.sideinfo_len,n,n%8,s),$.err.println("This is a fatal error. It has several possible causes:"),$.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),$.err.println(" 9%% Your system is overclocked"),$.err.println(" 1%% bug in LAME encoding library"),a.ResvSize=8*t.main_data_begin),1e9e.PeakSample?e.PeakSample=_[0][o]:-_[0][o]>e.PeakSample&&(e.PeakSample=-_[0][o]);if(1e.PeakSample?e.PeakSample=_[1][o]:-_[1][o]>e.PeakSample&&(e.PeakSample=-_[1][o])}if(e.findReplayGain&&c.AnalyzeSamples(e.rgdata,_[0],0,_[1],0,f,e.channels_out)==X.GAIN_ANALYSIS_ERROR)return-6}}return r},this.init_bit_stream_w=function(e){m=A(U.LAME_MAXMP3BUFFER),e.h_ptr=e.w_ptr=0,e.header[e.h_ptr].write_timing=0,p=-1,l=b=0}}function e(e,t,a,s){this.xlen=e,this.linmax=t,this.table=a,this.hlen=s}Ee.STEREO=new Ee(0),Ee.JOINT_STEREO=new Ee(1),Ee.DUAL_CHANNEL=new Ee(2),Ee.MONO=new Ee(3),Ee.NOT_SET=new Ee(4),X.STEPS_per_dB=100,X.MAX_dB=120,X.GAIN_NOT_ENOUGH_SAMPLES=-24601,X.GAIN_ANALYSIS_ERROR=0,X.GAIN_ANALYSIS_OK=1,X.INIT_GAIN_ANALYSIS_ERROR=0,X.INIT_GAIN_ANALYSIS_OK=1,X.MAX_ORDER=X.YULE_ORDER=10,X.MAX_SAMPLES_PER_WINDOW=(X.MAX_SAMP_FREQ=48e3)*(X.RMS_WINDOW_TIME_NUMERATOR=1)/(X.RMS_WINDOW_TIME_DENOMINATOR=20)+1,M.NUMTOCENTRIES=100,M.MAXFRAMESIZE=2880,q.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},q.NEQ=function(e,t){return!q.EQ(e,t)};var F={};function j(e){this.bits=e}function x(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}function r(e,t,a,s){this.l=Ae(1+Pe.SBMAX_l),this.s=Ae(1+Pe.SBMAX_s),this.psfb21=Ae(1+Pe.PSFB21),this.psfb12=Ae(1+Pe.PSFB12);var n=this.l,r=this.s;4==arguments.length&&(this.arrL=e,this.arrS=t,this.arr21=a,this.arr12=s,$.arraycopy(this.arrL,0,n,0,Math.min(this.arrL.length,this.l.length)),$.arraycopy(this.arrS,0,r,0,Math.min(this.arrS.length,this.s.length)),$.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),$.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}function T(){var l=null,m=null,s=null;this.setModules=function(e,t,a){l=e,m=t,s=a},this.IPOW20=function(e){return u[e]};var y=2.220446049250313e-16,f=T.IXMAX_VAL+2,c=T.Q_MAX,h=T.Q_MAX2,n=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var w=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=w,this.sfBandIndex=[new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0,8,16,24,36,52,72,96,124,160,162,164,166,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var R=Be(c+h+1),u=Be(c),p=Be(f),b=Be(f);function v(e,t){var a=s.ATHformula(t,e);return a-=n,a=Math.pow(10,a/10+e.ATHlower)}function A(e){this.s=e}this.adj43=b,this.iteration_init=function(e){var t,a=e.internal_flags,s=a.l3_side;if(0==a.iteration_init_init){for(a.iteration_init_init=1,s.main_data_begin=0,function(e){for(var t=e.internal_flags.ATH.l,a=e.internal_flags.ATH.psfb21,s=e.internal_flags.ATH.s,n=e.internal_flags.ATH.psfb12,r=e.internal_flags,i=e.out_samplerate,o=0;o>2&63)&&(t-=64),n=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>8&63)&&(t-=64),r=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>14&63)&&(t-=64),i=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>20&63)&&(t-=64),o=i*Math.pow(10,t/4/10),t=0;t3*s/4&&(f[o]=3*s/4),f[o]<0&&(f[o]=0),f[o]+a[o]>G.MAX_BITS_PER_CHANNEL&&(f[o]=Math.max(0,G.MAX_BITS_PER_CHANNEL-a[o])),i+=f[o];if(hG.MAX_BITS_PER_CHANNEL-e[0]&&(r=G.MAX_BITS_PER_CHANNEL-e[0]),r<0&&(r=0),125<=e[1]&&(125>1,A=0;do{A+=k=f[o]*f[o],M+=k>1;S=d/b,M=y;do{var k,x;A+=k=f[o]*f[o],M+=ks[r-3+1]&&(s[r-3+1]+=(s[r-3]-s[r-3+1])*i.decay),s[r-3+1]>s[r-3+2]&&(s[r-3+2]+=(s[r-3+1]-s[r-3+2])*i.decay))}return _},this.calc_noise_core=function(e,t,a,s){var n=0,r=t.s,i=e.l3_enc;if(r>e.count1)for(;0!=a--;){_=e.xr[r],r++,n+=_*_,_=e.xr[r],r++,n+=_*_}else if(r>e.big_values){var o=Be(2);for(o[0]=0,o[1]=s;0!=a--;){_=Math.abs(e.xr[r])-o[i[r]],r++,n+=_*_,_=Math.abs(e.xr[r])-o[i[r]],r++,n+=_*_}}else for(;0!=a--;){var _;_=Math.abs(e.xr[r])-p[i[r]]*s,r++,n+=_*_,_=Math.abs(e.xr[r])-p[i[r]]*s,r++,n+=_*_}return t.s=r,n},this.calc_noise=function(e,t,a,s,n){var r,i,o=0,_=0,l=0,f=0,c=0,h=-20,u=0,m=e.scalefac,p=0;for(r=s.over_SSD=0;r>1,u+e.width[r]>e.max_nonzero_coeff)i=0<(g=e.max_nonzero_coeff-u+1)?g>>1:0;var M=new A(u);d=this.calc_noise_core(e,M,i,S),u=M.s,null!=n&&(n.step[r]=v,n.noise[r]=d),d=a[o++]=d/t[_++],d=ee.FAST_LOG10(Math.max(d,1e-20)),null!=n&&(n.noise_log[r]=d)}if(null!=n&&(n.global_gain=e.global_gain),c+=d,0a.max_noise-.2&&a.tot_noisea.max_noise-.2&&a.tot_noisea.max_noise-.1&&a.tot_noise+a.over_noisea.max_noise-.15&&a.tot_noise+a.over_noise+a.over_noiset.xrpow_max&&(t.xrpow_max=s[f+c]);if(2==i.noise_shaping_amp)return}}}(e,t,a,s,n);var i=o(t);return!i&&(!(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t))||(1e.xrpow_max&&(e.xrpow_max=t[a+i])}e.scalefac[s]=r>>1}e.preflag=0,e.scalefac_scale=1}(t,s),i=!1):t.block_type==Pe.SHORT_TYPE&&0>t.scalefac_scale))n[s]=f,_+=3*l;else{n[s]=0;var c=210+(f<t.xrpow_max&&(t.xrpow_max=a[_+h]);_+=l*(3-r-1)}}var u=M.IPOW20(202);for(_+=t.width[s]*(r+1),h=-t.width[s];h<0;h++)a[_+h]*=u,a[_+h]>t.xrpow_max&&(t.xrpow_max=a[_+h])}}return!1}(r,t,s)||o(t))),i||(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t)),!i))}this.setModules=function(e,t,a,s){v=e,g=t,this.rv=t,M=a,this.qupvt=a,w=s,n.setModules(M,w)},this.ms_convert=function(e,t){for(var a=0;a<576;++a){var s=e.tt[t][0].xr[a],n=e.tt[t][1].xr[a];e.tt[t][0].xr[a]=(s+n)*(.5*ee.SQRT2),e.tt[t][1].xr[a]=(s-n)*(.5*ee.SQRT2)}},this.init_xrpow=function(e,t,a){var s=0,n=0|t.max_nonzero_coeff;if(t.xrpow_max=0,xe.fill(a,n,576,0),1e-20<(s=function(e,t,a,s){for(var n=s=0;n<=a;++n){var r=Math.abs(e.xr[n]);s+=r,t[n]=Math.sqrt(r*Math.sqrt(r)),t[n]>e.xrpow_max&&(e.xrpow_max=t[n])}return s}(t,a,n,s))){var r=0;0!=(2&e.substep_shaping)&&(r=1);for(var i=0;iS&&o.global_gain<=g;)o.global_gain++;if(o.global_gain>g)break;if(0==f.over_count){for(;(o.part2_3_length=w.count_bits(i,s,o,c))>h&&o.global_gain<=g;)o.global_gain++;if(o.global_gain>g)break}if(M.calc_noise(o,a,l,d,c),d.bits=o.part2_3_length,0!=(A(t.block_type!=Pe.SHORT_TYPE?e.quant_comp:e.quant_comp_short,f,d,o,l)?1:0))h=t.part2_3_length,f=d,t.assign(o),b=0,$.arraycopy(s,0,_,0,576);else if(0==i.full_outer_loop){if(++b>v&&0==f.over_count)break;if(3==i.noise_shaping_amp&&m&&30r[f.VBR_max_bitrate]&&(o[p][v]*=r[f.VBR_max_bitrate],o[p][v]/=u),i[p][v]>o[p][v]&&(i[p][v]=o[p][v]);return h},this.bitpressure_strategy=function(e,t,a,s){for(var n=0;nG.MAX_BITS_PER_CHANNEL&&(s[o][_]=G.MAX_BITS_PER_CHANNEL),m+=s[o][_]}if(G.MAX_BITS_PER_GRANULEG.MAX_BITS_PER_CHANNEL&&(s[o][_]=G.MAX_BITS_PER_CHANNEL),l+=s[o][_];if(l>r[0])for(o=0;o=s?(e.ATH.adjust*=.075*s+.925,e.ATH.adjust=s?e.ATH.adjust=s:e.ATH.adjust>1,u=(h=(c=s)<<1)+c,s=h<<1,r=(n=t)+m;M=e[n+0]-e[n+c],S=e[n+0]+e[n+c],B=e[n+h]-e[n+u],R=e[n+h]+e[n+u],e[n+h]=S-R,e[n+0]=S+R,e[n+u]=M-B,e[n+c]=M+B,M=e[r+0]-e[r+c],S=e[r+0]+e[r+c],B=ee.SQRT2*e[r+u],R=ee.SQRT2*e[r+h],e[r+h]=S-R,e[r+0]=S+R,e[r+u]=M-B,e[r+c]=M+B,r+=s,(n+=s)O[u+3-2]?Q/=O[u+3-2]:Q=O[u+3-2]>10*Q?O[u+3-2]/(10*Q):0,N[u+3]=Q}if(e.analysis){var W=N[0];for(u=1;u<12;u++)WC&&(q[u/3]=u%3+1);for(u=1;u<4;u++){(V[u-1]>V[u]?V[u-1]/V[u]:V[u]/V[u-1])<1.7&&(q[u]=0,1==u&&(q[0]=0))}for(0!=q[0]&&0!=S.nsPsy.lastAttacks[c]&&(q[0]=0),3!=S.nsPsy.lastAttacks[c]&&q[0]+q[1]+q[2]+q[3]==0||((D=0)!=q[1]&&0!=q[0]&&(q[1]=0),0!=q[2]&&0!=q[1]&&(q[2]=0),0!=q[3]&&0!=q[2]&&(q[3]=0)),c<2?x[c]=D:0==D&&(x[0]=x[1]=0),_[c]=S.tot_ener[c],he(e,F,j,M,1&c,w,1&c,s,c,t,a),Me(S,F,R,Y,X),we(S,Y,X,T),v=0;v<3;v++){var J,$;for(ve(e,j,A,B,c,v),pe(S,A,B,c,v),b=0;b1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var a=e.mld_l[t]*e.en[3].l[t],s=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],a));a=e.mld_l[t]*e.en[2].l[t];var n=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],a));e.thm[2].l[t]=s,e.thm[3].l[t]=n}for(t=0;t1.58*e.thm[1].s[t][r]||e.thm[1].s[t][r]>1.58*e.thm[0].s[t][r]||(a=e.mld_s[t]*e.en[3].s[t][r],s=Math.max(e.thm[2].s[t][r],Math.min(e.thm[3].s[t][r],a)),a=e.mld_s[t]*e.en[2].s[t][r],n=Math.max(e.thm[3].s[t][r],Math.min(e.thm[2].s[t][r],a)),e.thm[2].s[t][r]=s,e.thm[3].s[t][r]=n)}(S),g=e.msfix,0g&&(s[_]=g),1a[_]&&(s[_]=a[_]),l.masking_lower<1&&(s[_]*=l.masking_lower)}for(;_f&&(s[r]=f),1a[r]&&(s[r]=a[r]),e.masking_lower<1&&(s[r]*=e.masking_lower)}for(;rM[b+3-2]?E/=M[b+3-2]:E=M[b+3-2]>10*E?M[b+3-2]/(10*E):0,S[b+3]=E}for(b=0;b<3;++b){var P=M[3*b+3]+M[3*b+4]+M[3*b+5],I=1;6*M[3*b+5]B&&(_[m][b/3]=b%3+1);for(b=1;b<4;b++){var H=w[b-1],C=w[b];Math.max(H,C)<4e4&&H<1.7*C&&C<1.7*H&&(1==b&&_[m][0]<=_[m][b]&&(_[m][0]=0),_[m][b]=0)}_[m][0]<=c.nsPsy.lastAttacks[m]&&(_[m][0]=0),3!=c.nsPsy.lastAttacks[m]&&_[m][0]+_[m][1]+_[m][2]+_[m][3]==0||((k=0)!=_[m][1]&&0!=_[m][0]&&(_[m][1]=0),0!=_[m][2]&&0!=_[m][1]&&(_[m][2]=0),0!=_[m][3]&&0!=_[m][2]&&(_[m][3]=0)),m<2?l[m]=k:0==k&&(l[0]=l[1]=0),i[m]=c.tot_ener[m]}}(e,t,a,s,n,r,_,w,R,A),function(e,t){var a=e.internal_flags;e.short_blocks!=ye.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var s=0;s=n&&(p=i*(l[t]-n)/(24-n)+r*(24-l[t])/(24-n)),c[t]=Math.pow(10,p/10),0=n&&(p=_*(l[t]-n)/(24-n)+o*(24-l[t])/(24-n)),c[t]=Math.pow(10,p/10),g=Z.MAX_VALUE;for(v=0;va.npart_l-1&&(a.s3ind[M][1]=a.npart_l-1);var w=576*a.mode_gr/h;if(a.ATH.decay=Math.pow(10,-1.2*w),a.ATH.adjust=.01,-(a.ATH.adjustLimit=1)!=e.ATHtype){var R=e.out_samplerate/Pe.BLKSIZE,A=0;for(t=d=0;t=v)for(l=0;le.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=(t=0|e.lowpassfreq,a=e.in_samplerate,s=44100,48e3<=a?s=48e3:44100<=a?s=44100:32e3<=a?s=32e3:24e3<=a?s=24e3:22050<=a?s=22050:16e3<=a?s=16e3:12e3<=a?s=12e3:11025<=a?s=11025:8e3<=a&&(s=8e3),-1==t?s:(t<=15960&&(s=44100),t<=15250&&(s=32e3),t<=11220&&(s=24e3),t<=9970&&(s=22050),t<=7230&&(s=16e3),t<=5420&&(s=12e3),t<=4510&&(s=11025),t<=3970&&(s=8e3),a=t.lowpass2&&(a=Math.min(a,r)),t.lowpass1t.highpass1?E((t.highpass2-l)/(t.highpass2-t.highpass1+1e-20)):1,_=t.lowpass2>t.lowpass1?E((l-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[r]=o*_}}(e),n.samplerate_index=P(e.out_samplerate,e),n.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==Te.vbr_off){if(e.free_format)n.bitrate_index=0;else if(e.brate=I(e.brate,e.version,e.out_samplerate),n.bitrate_index=L(e.brate,e.version,e.out_samplerate),n.bitrate_index<=0)return e.internal_flags=null,-1}else n.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=n.pinfo&&(e.bWriteVbrTag=!1),R.init_bit_stream_w(n);for(var c,h,u,m=n.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),p=0;p=f){var M=i-u;if(0==i&&(M=0),(o=O(e,m[0],m[1],n,r,M))<0)return o;for(r+=o,u+=o,h.mf_size-=e.framesize,h.mf_samples_to_encode-=e.framesize,l=0;li&&(s.ResvMax=i),(s.ResvMax<0||e.disable_reservoir)&&(s.ResvMax=0);var o=t.bits*s.mode_gr+Math.min(s.ResvSize,s.ResvMax);return ad&&(d=e.length,S=A(g=0|1.25*d+7200));var a=n.lame_encode_buffer(v,e,t,e.length,S,0,g);return new Int8Array(S.subarray(0,a))},this.flush=function(){var e=n.lame_encode_flush(v,S,0,g);return new Int8Array(S.subarray(0,e))}}}t(),Recorder.lamejs=t}(); \ No newline at end of file