Free javascript Hosting


synthmin.js

Uploaded on May 15 2022 14:49 by jason.goldswain

!function(){function e(e){return function(){return e.apply(this,arguments)}}notelog=[],fC=1,fR=0,fS=0;let t={bell:"! ᐿ㲮᥈㲮㒑ᚃ᜿᡿᧽ᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳᤺㲮᥈㲮㒑ᚃ᜿᡿᧽ᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳᪷㲮᥈㲮㒑ᚃ᜿᡿᧽ᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳᮵㲮᥈㲮㒑ᚃ᜿᡿᧽ᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳ᬶ㲮᥈㲮㒑ᚃ᜿᡿᧽ᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲷㘎ᐊ㴀ᑁ㲳៾㙄᠄ᢅᬀᬀᬀᬀᬀᬁ㖽㺪ㅅ゙ᐊ㴀ᦹ㲮᥈㲮㒑ᚃ᜿᡿᧽ᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲺㘎ᐊ㴀ᑁ㲳៾㙄᠄ᢅᬀᬀᬀᬀᬀᬁ㖽㺪ㅅ゙ᐊ㴀᪷㲮᥈㲮㒑ᚃ᜿᡿᧽ᬀᬀᬀᬀᬀᬀ᮵ᒒ",drum:"! ᐿ㳬㦇ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳ᢻ㳬㦇ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳᤺㳬㦇ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳ᦹ㳬㦇ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳ᨸ㳬㦇ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳ᬶ㳬㦇ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᒒ",piano:"! ᐀᐀ᑅ㚺㚋ᐻ᐀ゝᐻ㞋㠊᣷ចᰵ㲷㚻㲶㘒ᐻ᐀ゝᐻ㞋㠊᣷ចᰵ㲷㚻㲶㖽㴀᥌ㅅᐹ㺪ㆌ㳶㲸ᒆᨄ㚍ᢽᓑᠼ㻲ចᒆ᡽᫉ㅅᐹ㺪ㆌ㳶㲸ᒆᨄ㚍ᢽᓑᠼ㻲ឃᒆ᡿㗀ᚄᒃᡸ㻥᐀ゝᐻ㞋㠊᣷ចᰵ㲷㚻㲶㗃᤺㲮᥈㲮㒑ᚃ᜿᠂᠈ᦀᦀᦀᦀᦀᦀᦀ㘀㴀ᡸ㲷ᒒ",organ:"! ᐀᐀ㅅᐹ㺪ㆌ㳶㲸ᒆᨄ㚍ᢽᓑᠼ㘒ᐻ᐀゙ᐊ㴀ᚄᓕᐻ㞋㠊᣷ចᰵ㲷㚻㲶㘀㺪ㅅᐹ㲮᥈㲳᥶㺪ㆌ㳶㲸ᒆᨄ㚍ᢽᓑᠼ㘒ᐻ᐀゙ᐊ㴀ᡸ㺪ㆌ㳶㲸ᒆᨄ㚍ᢽᓑᠼ㘒ᐻ᐀゙ᐊ㴀᣷㺪ㆌ㳶㲸ᒆᨄ㚍ᢽᓑᠼ㖽㴀ᡸ㲷ᒒ",pot:"! ᐿ㲮᥈㲮㒑ᚃ᜿᧽ᬀᬀᬀᬀᬀᬀᬁ㘎㜶᯸ᱻ៹჋㺪ㅅ゙ᐊ㴀ᚄ㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵㳵ና᠉᧼ᑸ㘒ᐻᐹ㲮᥈㲳᤺㲮᥈㲮㒑ᚃ᜿᧽ᬀᬀᬀᬀᬀᬀᬁ㘎㜶᯸ᱻ៹჋㺪ㅅ゙ᐊ㴀ᚆ㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵㳵ና᠉᧼ᑸ㘒ᐻᐹ㲮᥈㲳ᨸ㲮᥈㲮㒑ᚃ᜿᧽ᬀᬀᬀᬀᬀᬀᬁ㘎㜶᯸ᱻ៹჋㺪ㅅ゙ᐊ㴀ᚉ㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵㳵ና᠉᧼ᑸ㘒ᐻᐹ㲮᥈㲼㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵㳵ና᠉᧼ᑸ㗏",steeldrum:"! ᐿ㲮᥈㲮㒑ᚃ᜿᧽ᬀᬀᬀᬀᬀᬀᬁ㖽㺪ㅅ゙ᐊ㴀ᚄ㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳᤺㲮᥈㲮㒑ᚃ᜿᧽ᬀᬀᬀᬀᬀᬀᬁ㖽㺪ㅅ゙ᐊ㴀ᚆ㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲳ᨸ㲮᥈㲮㒑ᚃ᜿᧽ᬀᬀᬀᬀᬀᬀᬁ㖽㺪ㅅ゙ᐊ㴀ᚉ㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲼㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᓕᐻᐹ㲮᥈㲻㘎ᐊ㴀ᑁ㲳៾㙇ᢅᬀᬀᬀᬀᬀᬀ᮵ᒒ"},a=[];Synth=e(function(s,r=0){t[s]&&(s=t[s]);let i,_=new class{constructor(){function e(e){return e.split("").map(function(e){return e.charCodeAt()})}function t(t){let a=t[0].charCodeAt(),s=t.slice(1);return n=[].concat.apply([],e(s).map(function(e){return[Math.floor(e/a),e%a]})),String.fromCharCode.apply(String,n);var n}let a={},s=function(t){return Object.keys(a).map(function(e){t=t.split(a[e]).join(e)}),function(t){let a=(t=e(t)).slice().sort(function(e,t){return e<t})[0]+1,s=[];return t.map(function(e,t){t%2==0&&s.push([]),s[s.length-1].push(e)}),String.fromCharCode(a)+s.map(function(e){return String.fromCharCode(e[0]*a+e[1])}).join("")}(t)};this.to=(e=>(function(e){return a[e]})(e)),this.keys=(e=>(function(e){return Object.keys(a)})()),this.vals=(e=>(function(e){return Object.keys(a).map(function(e){return a[e]})})()),this.from=(e=>(function(e){return Object.keys(a).find(function(t){return a[t]==e})})(e)),this.add=((e,t)=>(function(e,t){return a[e]=t})(e,t)),this.compress=(e=>s(e)),this.uncompress=(e=>(function(e){return e=t(e),Object.keys(a).reverse().map(function(t){e=e.split(t).join(a[t])}),e.split("\0").join("").split(",)").join(")").split("00000").join("mn").split("000x").join("mx")})(e))}};var o;_.add("g","c(a)"),_.add("j","((a%50>20)?1:0)"),_.add("k","(2**(i/-3000"),_.add("l","))"),_.add("m","000"),_.add("n","00"),_.add("o","((i"),_.add("r",")?1:0)"),_.add("s","()"),_.add("z","*"),_.add("~","+"),_.add("9",">"),_.add("!","?1:0"),dta={fC:(o=s)[0].charCodeAt(),fR:o[1].charCodeAt(),fS:o[2].charCodeAt(),meth:_.uncompress(o.slice(3))},fC=dta.fC-32,fS=dta.fS-32,fR=dta.fR-32,i=dta.meth,this.delay=Math.max(0,r),this[Symbol.toStringTag]=0==this.delay?"Synthesizer":"DelayedSynthesizer";this.data=s,this.id="{hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh}".split("b").map(function(e,t){return 0==t?e:Math.floor(2*Math.random())+e}).join("").split("o").map(function(e,t){return 0==t?e:Math.floor(8*Math.random())+e}).join("").split("d").map(function(e,t){return 0==t?e:Math.floor(10*Math.random())+e}).join("").split("h").map(function(e,t){return 0==t?e:Math.floor(16*Math.random()).toString(16)+e}).join(""),this.play=e(function(t,s){g=i,"number"==typeof t&&(t=[t]);let r=this.delay,_=this.id;this.delay+=s;let o=function(){let e=new Function("a","b","i",`let b0,b1,b2,b3,b4,b5,b6=0,c=Math.sin,mn=Math.min,mx=Math.max,p=Math.PI,q=Math.log,e=Math.abs,f=Math.random;return ${g}`),n=[];t.map(function(t){let s=function(e,t,a=0){Date.now();let s,n=new(window.AudioContext||window.webkitAudioContext),r=1*n.sampleRate,i=!1,_=[],o=n.createBuffer(2,r,n.sampleRate);function l(a){let c,h=n.createBufferSource(),u=n.createGain();u.gain.value=1,_.push([h,u]);let b=440*2**((t*fC+fR+fS-36-69)/12);s=o.getChannelData(0);for(let t=a;t<r+a;t++)c=360*t/48e3*b,s[t-a]=e(c,b,t)+Math.round(t%(fR+2)/(fR+2)*2)*fR;s=Array.from(s),h.buffer=o,h.connect(u),u.connect(n.destination),a>=n.currentTime&&!i&&(h.start(a/n.sampleRate),h.stop(1)),i||setTimeout(function(){l(48e3*++f)},500)}l(0);let f=1;return l(48e3),{proc:s,stop:function(){i=!0,_.map(function(e){try{e[0].stop(),e[1].gain.setValueAtTime(0),e[1].gain.value=0}catch(e){n.suspend()}})}}}(e,t);n.push(s),a.push({type:"synth",time:48e3*r,samps:s.proc,id:_})}),setTimeout(function(){n.map(function(e){e.stop()})},1e3*s)};return setTimeout(function(){o()},1e3*this.delay),this[Symbol.toStringTag]=0==this.delay?"Synthesizer":"DelayedSynthesizer",this.stop=e(function(){n.map(function(e){e.stop()})}),this})}),Synth.Stream=e(function(t="*"){if(this[Symbol.toStringTag]="SynthesizerS",this.data=[],"*"!=t)Array.from(t).map(function(e){return e.id});this.capture=e(function(){this.data=a.filter(function(e){return"synth"==e.type&&("*"==t||ids.includes(e.id))}).map(function(e){return Array.from(new Uint8Array(e.time)).concat(e.samps)}).reduce(function(e,t){return t.length>e.length?t.map(function(t,a){return(e[a]||0)+t}):e.map(function(e,a){return(t[a]||0)+e})},[])})}),Synth.record=e(function(e,t){function a(){function e(e){return new Int8Array(e)}function t(e){return new Int16Array(e)}function s(e){return new Int32Array(e)}function n(e){return new Float32Array(e)}function r(e){return new Float64Array(e)}function i(e){if(1==e.length)return n(e[0]);var t=e[0];e=e.slice(1);for(var a=[],s=0;s<t;s++)a.push(i(e));return a}function _(e){if(1==e.length)return s(e[0]);var t=e[0];e=e.slice(1);for(var a=[],n=0;n<t;n++)a.push(_(e));return a}function o(e){if(1==e.length)return t(e[0]);var a=e[0];e=e.slice(1);for(var s=[],n=0;n<a;n++)s.push(o(e));return s}function l(e){if(1==e.length)return new Array(e[0]);var t=e[0];e=e.slice(1);for(var a=[],s=0;s<t;s++)a.push(l(e));return a}var f={fill:function(e,t,a,s){if(2==arguments.length)for(var n=0;n<e.length;n++)e[n]=arguments[1];else for(n=t;n<a;n++)e[n]=s}},c={arraycopy:function(e,t,a,s,n){for(var r=t+n;t<r;)a[s++]=e[t++]}},h={};function u(e){this.ordinal=e}h.SQRT2=1.4142135623730951,h.FAST_LOG10=function(e){return Math.log10(e)},h.FAST_LOG10_X=function(e,t){return Math.log10(e)*t},u.short_block_allowed=new u(0),u.short_block_coupled=new u(1),u.short_block_dispensed=new u(2),u.short_block_forced=new u(3);var b={};function p(e){this.ordinal=e}b.MAX_VALUE=3.4028235e38,p.vbr_off=new p(0),p.vbr_mt=new p(1),p.vbr_rh=new p(2),p.vbr_abr=new p(3),p.vbr_mtrh=new p(4),p.vbr_default=p.vbr_mtrh;function m(e){var t=e;this.ordinal=function(){return t}}function d(){var e=64.82,t=(d.YULE_ORDER,.95),a=(d.MAX_SAMP_FREQ,d.RMS_WINDOW_TIME_NUMERATOR),s=d.RMS_WINDOW_TIME_DENOMINATOR,n=(d.MAX_SAMPLES_PER_WINDOW,[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.26408300200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]]),r=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function i(e,t,a,s,n,r){for(;0!=n--;)a[s]=1e-10+e[t+0]*r[0]-a[s-1]*r[1]+e[t-1]*r[2]-a[s-2]*r[3]+e[t-2]*r[4]-a[s-3]*r[5]+e[t-3]*r[6]-a[s-4]*r[7]+e[t-4]*r[8]-a[s-5]*r[9]+e[t-5]*r[10]-a[s-6]*r[11]+e[t-6]*r[12]-a[s-7]*r[13]+e[t-7]*r[14]-a[s-8]*r[15]+e[t-8]*r[16]-a[s-9]*r[17]+e[t-9]*r[18]-a[s-10]*r[19]+e[t-10]*r[20],++s,++t}function _(e,t,a,s,n,r){for(;0!=n--;)a[s]=e[t+0]*r[0]-a[s-1]*r[1]+e[t-1]*r[2]-a[s-2]*r[3]+e[t-2]*r[4],++s,++t}function o(e){return e*e}this.InitGainAnalysis=function(e,t){return function(e,t){for(var n=0;n<MAX_ORDER;n++)e.linprebuf[n]=e.lstepbuf[n]=e.loutbuf[n]=e.rinprebuf[n]=e.rstepbuf[n]=e.routbuf[n]=0;switch(0|t){case 48e3:e.reqindex=0;break;case 44100:e.reqindex=1;break;case 32e3:e.reqindex=2;break;case 24e3:e.reqindex=3;break;case 22050:e.reqindex=4;break;case 16e3:e.reqindex=5;break;case 12e3:e.reqindex=6;break;case 11025:e.reqindex=7;break;case 8e3:e.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return e.sampleWindow=0|(t*a+s-1)/s,e.lsum=0,e.rsum=0,e.totsamp=0,f.ill(e.A,0),INIT_GAIN_ANALYSIS_OK}(e,t)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(e.linpre=MAX_ORDER,e.rinpre=MAX_ORDER,e.lstep=MAX_ORDER,e.rstep=MAX_ORDER,e.lout=MAX_ORDER,e.rout=MAX_ORDER,f.fill(e.B,0),INIT_GAIN_ANALYSIS_OK)},this.AnalyzeSamples=function(e,t,a,s,l,f,h){var u,b,p,m,v,g,S;if(0==f)return GAIN_ANALYSIS_OK;switch(S=0,v=f,h){case 1:s=t,l=a;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(f<MAX_ORDER?(c.arraycopy(t,a,e.linprebuf,MAX_ORDER,f),c.arraycopy(s,l,e.rinprebuf,MAX_ORDER,f)):(c.arraycopy(t,a,e.linprebuf,MAX_ORDER,MAX_ORDER),c.arraycopy(s,l,e.rinprebuf,MAX_ORDER,MAX_ORDER));v>0;){g=v>e.sampleWindow-e.totsamp?e.sampleWindow-e.totsamp:v,S<MAX_ORDER?(u=e.linpre+S,b=e.linprebuf,p=e.rinpre+S,m=e.rinprebuf,g>MAX_ORDER-S&&(g=MAX_ORDER-S)):(u=a+S,b=t,p=l+S,m=s),i(b,u,e.lstepbuf,e.lstep+e.totsamp,g,n[e.reqindex]),i(m,p,e.rstepbuf,e.rstep+e.totsamp,g,n[e.reqindex]),_(e.lstepbuf,e.lstep+e.totsamp,e.loutbuf,e.lout+e.totsamp,g,r[e.reqindex]),_(e.rstepbuf,e.rstep+e.totsamp,e.routbuf,e.rout+e.totsamp,g,r[e.reqindex]),u=e.lout+e.totsamp,b=e.loutbuf,p=e.rout+e.totsamp,m=e.routbuf;for(var R=g%8;0!=R--;)e.lsum+=o(b[u++]),e.rsum+=o(m[p++]);for(R=g/8;0!=R--;)e.lsum+=o(b[u+0])+o(b[u+1])+o(b[u+2])+o(b[u+3])+o(b[u+4])+o(b[u+5])+o(b[u+6])+o(b[u+7]),u+=8,e.rsum+=o(m[p+0])+o(m[p+1])+o(m[p+2])+o(m[p+3])+o(m[p+4])+o(m[p+5])+o(m[p+6])+o(m[p+7]),p+=8;if(v-=g,S+=g,e.totsamp+=g,e.totsamp==e.sampleWindow){var M=10*d.STEPS_per_dB*Math.log10((e.lsum+e.rsum)/e.totsamp*.5+1e-37),A=M<=0?0:0|M;A>=e.A.length&&(A=e.A.length-1),e.A[A]++,e.lsum=e.rsum=0,c.arraycopy(e.loutbuf,e.totsamp,e.loutbuf,0,MAX_ORDER),c.arraycopy(e.routbuf,e.totsamp,e.routbuf,0,MAX_ORDER),c.arraycopy(e.lstepbuf,e.totsamp,e.lstepbuf,0,MAX_ORDER),c.arraycopy(e.rstepbuf,e.totsamp,e.rstepbuf,0,MAX_ORDER),e.totsamp=0}if(e.totsamp>e.sampleWindow)return GAIN_ANALYSIS_ERROR}return f<MAX_ORDER?(c.arraycopy(e.linprebuf,f,e.linprebuf,0,MAX_ORDER-f),c.arraycopy(e.rinprebuf,f,e.rinprebuf,0,MAX_ORDER-f),c.arraycopy(t,a,e.linprebuf,MAX_ORDER-f,f),c.arraycopy(s,l,e.rinprebuf,MAX_ORDER-f,f)):(c.arraycopy(t,a+f-MAX_ORDER,e.linprebuf,0,MAX_ORDER),c.arraycopy(s,l+f-MAX_ORDER,e.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK},this.GetTitleGain=function(a){for(var s=function(a,s){var n,r=0;for(n=0;n<s;n++)r+=a[n];if(0==r)return GAIN_NOT_ENOUGH_SAMPLES;var i=0|Math.ceil(r*(1-t));for(n=s;n-- >0&&!((i-=a[n])<=0););return e-n/d.STEPS_per_dB}(a.A,a.A.length),n=0;n<a.A.length;n++)a.B[n]+=a.A[n],a.A[n]=0;for(n=0;n<MAX_ORDER;n++)a.linprebuf[n]=a.lstepbuf[n]=a.loutbuf[n]=a.rinprebuf[n]=a.rstepbuf[n]=a.routbuf[n]=0;return a.totsamp=0,a.lsum=a.rsum=0,s}}function v(){var e=null;function t(e){this.bits=0|e}this.qupvt=null,this.setModules=function(t){this.qupvt=t,e=t};var a=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function n(e,t,a,s,n,r){var i=.5946/t;for(e>>=1;0!=e--;)n[r++]=i>a[s++]?0:1,n[r++]=i>a[s++]?0:1}function r(t,a,s,n,r,i){var _=(t>>=1)%2;for(t>>=1;0!=t--;){var o,l,f,c,h,u,b,p;o=s[n++]*a,l=s[n++]*a,h=0|o,f=s[n++]*a,u=0|l,c=s[n++]*a,b=0|f,o+=e.adj43[h],p=0|c,l+=e.adj43[u],r[i++]=0|o,f+=e.adj43[b],r[i++]=0|l,c+=e.adj43[p],r[i++]=0|f,r[i++]=0|c}0!=_&&(h=0|(o=s[n++]*a),u=0|(l=s[n++]*a),o+=e.adj43[h],l+=e.adj43[u],r[i++]=0|o,r[i++]=0|l)}var i=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function _(e,t,a,s){var n=function(e,t,a){var s=0,n=0;do{var r=e[t++],i=e[t++];s<r&&(s=r),n<i&&(n=i)}while(t<a);return s<n&&(s=n),s}(e,t,a);switch(n){case 0:return n;case 1:return function(e,t,a,s){var n=0,r=M.ht[1].hlen;do{var i=2*e[t+0]+e[t+1];t+=2,n+=r[i]}while(t<a);return s.bits+=n,1}(e,t,a,s);case 2:case 3:return function(e,t,a,s,n){var r,i,_=0,o=M.ht[s].xlen;i=2==s?M.table23:M.table56;do{var l=e[t+0]*o+e[t+1];t+=2,_+=i[l]}while(t<a);return r=65535&_,(_>>=16)>r&&(_=r,s++),n.bits+=_,s}(e,t,a,i[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,_=0,o=M.ht[s].xlen,l=M.ht[s].hlen,f=M.ht[s+1].hlen,c=M.ht[s+2].hlen;do{var h=e[t+0]*o+e[t+1];t+=2,r+=l[h],i+=f[h],_+=c[h]}while(t<a);var u=s;return r>i&&(r=i,u++),r>_&&(r=_,u=s+2),n.bits+=r,u}(e,t,a,i[n-1],s);default:if(n>T.IXMAX_VAL)return s.bits=T.LARGE_BITS,-1;var r,_;for(n-=15,r=24;r<32&&!(M.ht[r].linmax>=n);r++);for(_=r-8;_<24&&!(M.ht[_].linmax>=n);_++);return function(e,t,a,s,n,r){var i,_=65536*M.ht[s].xlen+M.ht[n].xlen,o=0;do{var l=e[t++],f=e[t++];0!=l&&(l>14&&(l=15,o+=_),l*=16),0!=f&&(f>14&&(f=15,o+=_),l+=f),o+=M.largetbl[l]}while(t<a);return i=65535&o,(o>>=16)>i&&(o=i,s=n),r.bits+=o,s}(e,t,a,_,r,s)}}function o(e,a,s,n,r,i,o,l){for(var f=a.big_values,c=2;c<P.SBMAX_l+1;c++){var h=e.scalefac_band.l[c];if(h>=f)break;var u=r[c-2]+a.count1bits;if(s.part2_3_length<=u)break;var b=new t(u),p=_(n,h,f,b);u=b.bits,s.part2_3_length<=u||(s.assign(a),s.part2_3_length=u,s.region0_count=i[c-2],s.region1_count=c-2-i[c-2],s.table_select[0]=o[c-2],s.table_select[1]=l[c-2],s.table_select[2]=p)}}this.noquant_count_bits=function(e,a,s){var n=a.l3_enc,r=Math.min(576,a.max_nonzero_coeff+2>>1<<1);for(null!=s&&(s.sfb_count1=0);r>1&&0==(n[r-1]|n[r-2]);r-=2);a.count1=r;for(var i=0,o=0;r>3;r-=4){var l;if((2147483647&(n[r-1]|n[r-2]|n[r-3]|n[r-4]))>1)break;l=2*(2*(2*n[r-4]+n[r-3])+n[r-2])+n[r-1],i+=M.t32l[l],o+=M.t33l[l]}var f=i;if(a.count1table_select=0,i>o&&(f=o,a.count1table_select=1),a.count1bits=f,a.big_values=r,0==r)return f;if(a.block_type==P.SHORT_TYPE)(i=3*e.scalefac_band.s[3])>a.big_values&&(i=a.big_values),o=a.big_values;else if(a.block_type==P.NORM_TYPE){if(i=a.region0_count=e.bv_scf[r-2],o=a.region1_count=e.bv_scf[r-1],o=e.scalefac_band.l[i+o+2],i=e.scalefac_band.l[i+1],o<r){var c=new t(f);a.table_select[2]=_(n,o,r,c),f=c.bits}}else a.region0_count=7,a.region1_count=P.SBMAX_l-1-7-1,(i=e.scalefac_band.l[8])>(o=r)&&(i=o);if(i=Math.min(i,r),o=Math.min(o,r),0<i){c=new t(f);a.table_select[0]=_(n,0,i,c),f=c.bits}if(i<o){c=new t(f);a.table_select[1]=_(n,i,o,c),f=c.bits}if(2==e.use_best_huffman&&(a.part2_3_length=f,best_huffman_divide(e,a),f=a.part2_3_length),null!=s&&a.block_type==P.NORM_TYPE){for(var h=0;e.scalefac_band.l[h]<a.big_values;)h++;s.sfb_count1=h}return f},this.count_bits=function(t,a,s,i){var _=s.l3_enc,o=T.IXMAX_VAL/e.IPOW20(s.global_gain);if(s.xrpow_max>o)return T.LARGE_BITS;if(function(t,a,s,i,_){var o,l,c,h=0,u=0,b=0,p=0,m=a,d=0,v=m,g=0,S=t,R=0;for(c=null!=_&&i.global_gain==_.global_gain,l=i.block_type==P.SHORT_TYPE?38:21,o=0;o<=l;o++){var M=-1;if((c||i.block_type==P.NORM_TYPE)&&(M=i.global_gain-(i.scalefac[o]+(0!=i.preflag?e.pretab[o]:0)<<i.scalefac_scale+1)-8*i.subblock_gain[i.window[o]]),c&&_.step[o]==M)0!=u&&(r(u,s,S,R,v,g),u=0),0!=b&&(n(b,s,S,R,v,g),b=0);else{var A,B=i.width[o];if(h+i.width[o]>i.max_nonzero_coeff&&(A=i.max_nonzero_coeff-h+1,f.fill(a,i.max_nonzero_coeff,576,0),(B=A)<0&&(B=0),o=l+1),0==u&&0==b&&(v=m,g=d,S=t,R=p),null!=_&&_.sfb_count1>0&&o>=_.sfb_count1&&_.step[o]>0&&M>=_.step[o]?(0!=u&&(r(u,s,S,R,v,g),u=0,v=m,g=d,S=t,R=p),b+=B):(0!=b&&(n(b,s,S,R,v,g),b=0,v=m,g=d,S=t,R=p),u+=B),B<=0){0!=b&&(n(b,s,S,R,v,g),b=0),0!=u&&(r(u,s,S,R,v,g),u=0);break}}o<=l&&(d+=i.width[o],p+=i.width[o],h+=i.width[o])}0!=u&&(r(u,s,S,R,v,g),u=0),0!=b&&(n(b,s,S,R,v,g),b=0)}(a,_,e.IPOW20(s.global_gain),s,i),0!=(2&t.substep_shaping))for(var l=0,c=s.global_gain+s.scalefac_scale,h=.634521682242439/e.IPOW20(c),u=0;u<s.sfbmax;u++){var b,p=s.width[u];if(0==t.pseudohalf[u])l+=p;else for(b=l,l+=p;b<l;++b)_[b]=a[b]>=h?_[b]:0}return this.noquant_count_bits(t,s,i)},this.best_huffman_divide=function(e,a){var n=new E,r=a.l3_enc,i=s(23),l=s(23),f=s(23),c=s(23);if(a.block_type!=P.SHORT_TYPE||1!=e.mode_gr){n.assign(a),a.block_type==P.NORM_TYPE&&(!function(e,a,s,n,r,i,o){for(var l=a.big_values,f=0;f<=22;f++)n[f]=T.LARGE_BITS;for(f=0;f<16;f++){var c=e.scalefac_band.l[f+1];if(c>=l)break;var h=0,u=new t(h),b=_(s,0,c,u);h=u.bits;for(var p=0;p<8;p++){var m=e.scalefac_band.l[f+p+2];if(m>=l)break;var d=h,v=_(s,c,m,u=new t(d));d=u.bits,n[f+p]>d&&(n[f+p]=d,r[f+p]=f,i[f+p]=b,o[f+p]=v)}}}(e,a,r,i,l,f,c),o(e,n,a,r,i,l,f,c));var h=n.big_values;if(!(0==h||(r[h-2]|r[h-1])>1||(h=a.count1+2)>576)){n.assign(a),n.count1=h;for(var u=0,b=0;h>n.big_values;h-=4){var p=2*(2*(2*r[h-4]+r[h-3])+r[h-2])+r[h-1];u+=M.t32l[p],b+=M.t33l[p]}if(n.big_values=h,n.count1table_select=0,u>b&&(u=b,n.count1table_select=1),n.count1bits=u,n.block_type==P.NORM_TYPE)o(e,n,a,r,i,l,f,c);else{if(n.part2_3_length=u,(u=e.scalefac_band.l[8])>h&&(u=h),u>0){var m=new t(n.part2_3_length);n.table_select[0]=_(r,0,u,m),n.part2_3_length=m.bits}if(h>u){m=new t(n.part2_3_length);n.table_select[1]=_(r,u,h,m),n.part2_3_length=m.bits}a.part2_3_length>n.part2_3_length&&a.assign(n)}}}};var l=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],h=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],u=[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];v.slen1_tab=u,v.slen2_tab=b,this.best_scalefac_store=function(t,a,s,n){var r,i,_,o,f=n.tt[a][s],c=0;for(_=0,r=0;r<f.sfbmax;r++){var p=f.width[r];for(_+=p,o=-p;o<0&&0==f.l3_enc[o+_];o++);0==o&&(f.scalefac[r]=c=-2)}if(0==f.scalefac_scale&&0==f.preflag){var m=0;for(r=0;r<f.sfbmax;r++)f.scalefac[r]>0&&(m|=f.scalefac[r]);if(0==(1&m)&&0!=m){for(r=0;r<f.sfbmax;r++)f.scalefac[r]>0&&(f.scalefac[r]>>=1);f.scalefac_scale=c=1}}if(0==f.preflag&&f.block_type!=P.SHORT_TYPE&&2==t.mode_gr){for(r=11;r<P.SBPSY_l&&!(f.scalefac[r]<e.pretab[r]&&-2!=f.scalefac[r]);r++);if(r==P.SBPSY_l){for(r=11;r<P.SBPSY_l;r++)f.scalefac[r]>0&&(f.scalefac[r]-=e.pretab[r]);f.preflag=c=1}}for(i=0;i<4;i++)n.scfsi[s][i]=0;for(2==t.mode_gr&&1==a&&n.tt[0][s].block_type!=P.SHORT_TYPE&&n.tt[1][s].block_type!=P.SHORT_TYPE&&(!function(e,t){for(var a,s=t.tt[1][e],n=t.tt[0][e],r=0;r<M.scfsi_band.length-1;r++){for(a=M.scfsi_band[r];a<M.scfsi_band[r+1]&&!(n.scalefac[a]!=s.scalefac[a]&&s.scalefac[a]>=0);a++);if(a==M.scfsi_band[r+1]){for(a=M.scfsi_band[r];a<M.scfsi_band[r+1];a++)s.scalefac[a]=-1;t.scfsi[e][r]=1}}var i=0,_=0;for(a=0;a<11;a++)-1!=s.scalefac[a]&&(_++,i<s.scalefac[a]&&(i=s.scalefac[a]));for(var o=0,f=0;a<P.SBPSY_l;a++)-1!=s.scalefac[a]&&(f++,o<s.scalefac[a]&&(o=s.scalefac[a]));for(r=0;r<16;r++)if(i<l[r]&&o<h[r]){var c=u[r]*_+b[r]*f;s.part2_length>c&&(s.part2_length=c,s.scalefac_compress=r)}}(s,n),c=0),r=0;r<f.sfbmax;r++)-2==f.scalefac[r]&&(f.scalefac[r]=0);0!=c&&(2==t.mode_gr?this.scale_bitcount(f):this.scale_bitcount_lsf(t,f))};var p=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],m=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],d=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(t){var a,s,n,r=0,i=0,_=t.scalefac;if(t.block_type==P.SHORT_TYPE)n=p,0!=t.mixed_block_flag&&(n=m);else if(n=d,0==t.preflag){for(s=11;s<P.SBPSY_l&&!(_[s]<e.pretab[s]);s++);if(s==P.SBPSY_l)for(t.preflag=1,s=11;s<P.SBPSY_l;s++)_[s]-=e.pretab[s]}for(s=0;s<t.sfbdivide;s++)r<_[s]&&(r=_[s]);for(;s<t.sfbmax;s++)i<_[s]&&(i=_[s]);for(t.part2_length=T.LARGE_BITS,a=0;a<16;a++)r<l[a]&&i<h[a]&&t.part2_length>n[a]&&(t.part2_length=n[a],t.scalefac_compress=a);return t.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(t,a){var n,r,i,_,o,l,f,h,u=s(4),b=a.scalefac;for(n=0!=a.preflag?2:0,f=0;f<4;f++)u[f]=0;if(a.block_type==P.SHORT_TYPE){r=1;var p=e.nr_of_sfb_block[n][r];for(h=0,i=0;i<4;i++)for(_=p[i]/3,f=0;f<_;f++,h++)for(o=0;o<3;o++)b[3*h+o]>u[i]&&(u[i]=b[3*h+o])}else{r=0;p=e.nr_of_sfb_block[n][r];for(h=0,i=0;i<4;i++)for(_=p[i],f=0;f<_;f++,h++)b[h]>u[i]&&(u[i]=b[h])}for(l=!1,i=0;i<4;i++)u[i]>g[n][i]&&(l=!0);if(!l){var m,d,v,R;for(a.sfb_partition_table=e.nr_of_sfb_block[n][r],i=0;i<4;i++)a.slen[i]=S[u[i]];switch(m=a.slen[0],d=a.slen[1],v=a.slen[2],R=a.slen[3],n){case 0:a.scalefac_compress=(5*m+d<<4)+(v<<2)+R;break;case 1:a.scalefac_compress=400+(5*m+d<<2)+v;break;case 2:a.scalefac_compress=500+3*m+d;break;default:c.err.printf("intensity stereo not implemented yet\n")}}if(!l)for(a.part2_length=0,i=0;i<4;i++)a.part2_length+=a.slen[i]*a.sfb_partition_table[i];return l};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 s,n=0;e.scalefac_band.l[++n]<t;);for(s=a[n][0];e.scalefac_band.l[s+1]>t;)s--;for(s<0&&(s=a[n][0]),e.bv_scf[t-2]=s,s=a[n][1];e.scalefac_band.l[s+e.bv_scf[t-2]+2]>t;)s--;s<0&&(s=a[n][1]),e.bv_scf[t-1]=s}}}function g(){var t=this,a=32773,n=null,r=null,_=null,o=null;this.setModules=function(e,t,a,s){n=e,r=t,_=a,o=s};var l=null,h=0,u=0,b=0;function p(e){c.arraycopy(e.header[e.w_ptr].buf,0,l,u,e.sideinfo_len),u+=e.sideinfo_len,h+=8*e.sideinfo_len,e.w_ptr=e.w_ptr+1&H.MAX_HEADER_BUF-1}function m(e,t,a){for(;a>0;){var s;0==b&&(b=8,u++,e.header[e.w_ptr].write_timing==h&&p(e),l[u]=0),a-=s=Math.min(a,b),b-=s,l[u]|=t>>a<<b,h+=s}}function g(e,t,a){for(;a>0;){var s;0==b&&(b=8,l[++u]=0),a-=s=Math.min(a,b),b-=s,l[u]|=t>>a<<b,h+=s}}function S(e,t){var a,s=e.internal_flags;if(t>=8&&(m(s,76,8),t-=8),t>=8&&(m(s,65,8),t-=8),t>=8&&(m(s,77,8),t-=8),t>=8&&(m(s,69,8),t-=8),t>=32){var n=_.getLameShortVersion();if(t>=32)for(a=0;a<n.length&&t>=8;++a)t-=8,m(s,n.charAt(a),8)}for(;t>=1;t-=1)m(s,s.ancillary_flag,1),s.ancillary_flag^=e.disable_reservoir?0:1}function R(e,t,a){for(var s=e.header[e.h_ptr].ptr;a>0;){var n=Math.min(a,8-(7&s));a-=n,e.header[e.h_ptr].buf[s>>3]|=t>>a<<8-(7&s)-n,s+=n}e.header[e.h_ptr].ptr=s}function A(e,t){e<<=8;for(var s=0;s<8;s++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=a);return t}function B(e,t){var a,s=M.ht[t.count1table_select+32],n=0,r=t.big_values,i=t.big_values;for(a=(t.count1-t.big_values)/4;a>0;--a){var _=0,o=0;0!=t.l3_enc[r+0]&&(o+=8,t.xr[i+0]<0&&_++),0!=t.l3_enc[r+1]&&(o+=4,_*=2,t.xr[i+1]<0&&_++),0!=t.l3_enc[r+2]&&(o+=2,_*=2,t.xr[i+2]<0&&_++),0!=t.l3_enc[r+3]&&(o++,_*=2,t.xr[i+3]<0&&_++),r+=4,i+=4,m(e,_+s.table[o],s.hlen[o]),n+=s.hlen[o]}return n}function w(e,t,a,s,n){var r=M.ht[t],i=0;if(0==t)return i;for(var _=a;_<s;_+=2){var o=0,l=0,f=r.xlen,c=r.xlen,h=0,u=n.l3_enc[_],b=n.l3_enc[_+1];if(0!=u&&(n.xr[_]<0&&h++,o--),t>15){if(u>14)h|=u-15<<1,l=f,u=15;if(b>14)h<<=f,h|=b-15,l+=f,b=15;c=16}0!=b&&(h<<=1,n.xr[_+1]<0&&h++,o--),u=u*c+b,l-=o,o+=r.hlen[u],m(e,r.table[u],o),m(e,h,l),i+=o+l}return i}function T(e,t){var a=3*e.scalefac_band.s[3];a>t.big_values&&(a=t.big_values);var s=w(e,t.table_select[0],0,a,t);return s+=w(e,t.table_select[1],a,t.big_values,t)}function E(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,n>a&&(n=a),(r=e.scalefac_band.l[i])>a&&(r=a),s=w(e,t.table_select[0],0,n,t),s+=w(e,t.table_select[1],n,r,t),s+=w(e,t.table_select[2],r,a,t)}function y(){this.total=0}function k(e,a){var s,n,r,i,_,o=e.internal_flags;return _=o.w_ptr,-1==(i=o.h_ptr-1)&&(i=H.MAX_HEADER_BUF-1),s=o.header[i].write_timing-h,a.total=s,s>=0&&(n=1+i-_,i<_&&(n=1+i-_+H.MAX_HEADER_BUF),s-=8*n*o.sideinfo_len),s+=r=t.getframebits(e),a.total+=r,a.total%8!=0?a.total=1+a.total/8:a.total=a.total/8,a.total+=u+1,s<0&&c.err.println("strange error flushing buffer ... \n"),s}this.getframebits=function(e){var t,a=e.internal_flags;return t=0!=a.bitrate_index?M.bitrate_table[e.version][a.bitrate_index]:e.brate,8*(0|72e3*(e.version+1)*t/e.out_samplerate+a.padding)},this.CRC_writeheader=function(e,t){var a=65535;a=A(255&t[2],a),a=A(255&t[3],a);for(var s=6;s<e.sideinfo_len;s++)a=A(255&t[s],a);t[4]=byte(a>>8),t[5]=byte(255&a)},this.flush_bitstream=function(e){var t,a,s=e.internal_flags,r=s.h_ptr-1;if(-1==r&&(r=H.MAX_HEADER_BUF-1),t=s.l3_side,!((a=k(e,new y))<0)){if(S(e,a),s.ResvSize=0,t.main_data_begin=0,s.findReplayGain){var i=n.GetTitleGain(s.rgdata);s.RadioGain=0|Math.floor(10*i+.5)}s.findPeakSample&&(s.noclipGainChange=0|Math.ceil(20*Math.log10(s.PeakSample/32767)*10),s.noclipGainChange>0&&(EQ(e.scale,1)||EQ(e.scale,0))?s.noclipScale=Math.floor(32767/s.PeakSample*100)/100:s.noclipScale=-1)}},this.add_dummy_byte=function(e,t,a){for(var s,n=e.internal_flags;a-- >0;)for(g(0,t,8),s=0;s<H.MAX_HEADER_BUF;++s)n.header[s].write_timing+=8},this.format_bitstream=function(e){var t,a=e.internal_flags;t=a.l3_side;var s=this.getframebits(e);S(e,t.resvDrain_pre),function(e,t){var a,s,n,r=e.internal_flags;if(a=r.l3_side,r.header[r.h_ptr].ptr=0,f.fill(r.header[r.h_ptr].buf,0,r.sideinfo_len,0),e.out_samplerate<16e3?R(r,4094,12):R(r,4095,12),R(r,e.version,1),R(r,1,2),R(r,e.error_protection?0:1,1),R(r,r.bitrate_index,4),R(r,r.samplerate_index,2),R(r,r.padding,1),R(r,e.extension,1),R(r,e.mode.ordinal(),2),R(r,r.mode_ext,2),R(r,e.copyright,1),R(r,e.original,1),R(r,e.emphasis,2),e.error_protection&&R(r,0,16),1==e.version){for(R(r,a.main_data_begin,9),2==r.channels_out?R(r,a.private_bits,3):R(r,a.private_bits,5),n=0;n<r.channels_out;n++){var i;for(i=0;i<4;i++)R(r,a.scfsi[n][i],1)}for(s=0;s<2;s++)for(n=0;n<r.channels_out;n++)R(r,(_=a.tt[s][n]).part2_3_length+_.part2_length,12),R(r,_.big_values/2,9),R(r,_.global_gain,8),R(r,_.scalefac_compress,4),_.block_type!=P.NORM_TYPE?(R(r,1,1),R(r,_.block_type,2),R(r,_.mixed_block_flag,1),14==_.table_select[0]&&(_.table_select[0]=16),R(r,_.table_select[0],5),14==_.table_select[1]&&(_.table_select[1]=16),R(r,_.table_select[1],5),R(r,_.subblock_gain[0],3),R(r,_.subblock_gain[1],3),R(r,_.subblock_gain[2],3)):(R(r,0,1),14==_.table_select[0]&&(_.table_select[0]=16),R(r,_.table_select[0],5),14==_.table_select[1]&&(_.table_select[1]=16),R(r,_.table_select[1],5),14==_.table_select[2]&&(_.table_select[2]=16),R(r,_.table_select[2],5),R(r,_.region0_count,4),R(r,_.region1_count,3)),R(r,_.preflag,1),R(r,_.scalefac_scale,1),R(r,_.count1table_select,1)}else for(R(r,a.main_data_begin,8),R(r,a.private_bits,r.channels_out),s=0,n=0;n<r.channels_out;n++){var _;R(r,(_=a.tt[s][n]).part2_3_length+_.part2_length,12),R(r,_.big_values/2,9),R(r,_.global_gain,8),R(r,_.scalefac_compress,9),_.block_type!=P.NORM_TYPE?(R(r,1,1),R(r,_.block_type,2),R(r,_.mixed_block_flag,1),14==_.table_select[0]&&(_.table_select[0]=16),R(r,_.table_select[0],5),14==_.table_select[1]&&(_.table_select[1]=16),R(r,_.table_select[1],5),R(r,_.subblock_gain[0],3),R(r,_.subblock_gain[1],3),R(r,_.subblock_gain[2],3)):(R(r,0,1),14==_.table_select[0]&&(_.table_select[0]=16),R(r,_.table_select[0],5),14==_.table_select[1]&&(_.table_select[1]=16),R(r,_.table_select[1],5),14==_.table_select[2]&&(_.table_select[2]=16),R(r,_.table_select[2],5),R(r,_.region0_count,4),R(r,_.region1_count,3)),R(r,_.scalefac_scale,1),R(r,_.count1table_select,1)}e.error_protection&&CRC_writeheader(r,r.header[r.h_ptr].buf);var o=r.h_ptr;r.h_ptr=o+1&H.MAX_HEADER_BUF-1,r.header[r.h_ptr].write_timing=r.header[o].write_timing+t,r.h_ptr==r.w_ptr&&c.err.println("Error: MAX_HEADER_BUF too small in bitstream.c \n")}(e,s);var n=8*a.sideinfo_len;if(n+=function(e){var t,a,s,n,r=0,i=e.internal_flags,_=i.l3_side;if(1==e.version)for(t=0;t<2;t++)for(a=0;a<i.channels_out;a++){var o=_.tt[t][a],l=v.slen1_tab[o.scalefac_compress],f=v.slen2_tab[o.scalefac_compress];for(n=0,s=0;s<o.sfbdivide;s++)-1!=o.scalefac[s]&&(m(i,o.scalefac[s],l),n+=l);for(;s<o.sfbmax;s++)-1!=o.scalefac[s]&&(m(i,o.scalefac[s],f),n+=f);o.block_type==P.SHORT_TYPE?n+=T(i,o):n+=E(i,o),r+=n+=B(i,o)}else for(t=0,a=0;a<i.channels_out;a++){var c,h,u=0;if(n=0,s=0,h=0,(o=_.tt[t][a]).block_type==P.SHORT_TYPE){for(;h<4;h++){var b=o.sfb_partition_table[h]/3,p=o.slen[h];for(c=0;c<b;c++,s++)m(i,Math.max(o.scalefac[3*s+0],0),p),m(i,Math.max(o.scalefac[3*s+1],0),p),m(i,Math.max(o.scalefac[3*s+2],0),p),u+=3*p}n+=T(i,o)}else{for(;h<4;h++)for(b=o.sfb_partition_table[h],p=o.slen[h],c=0;c<b;c++,s++)m(i,Math.max(o.scalefac[s],0),p),u+=p;n+=E(i,o)}r+=u+(n+=B(i,o))}return r}(e),S(e,t.resvDrain_post),n+=t.resvDrain_post,t.main_data_begin+=(s-n)/8,k(e,new y)!=a.ResvSize&&c.err.println("Internal buffer inconsistency. flushbits <> ResvSize"),8*t.main_data_begin!=a.ResvSize&&(c.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),c.err.println("This is a fatal error. It has several possible causes:"),c.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),c.err.println(" 9%% Your system is overclocked"),c.err.println(" 1%% bug in LAME encoding library"),a.ResvSize=8*t.main_data_begin),h>1e9){var r;for(r=0;r<H.MAX_HEADER_BUF;++r)a.header[r].write_timing-=h;h=0}return 0},this.copy_buffer=function(e,t,a,_,f){var h=u+1;if(h<=0)return 0;if(0!=_&&h>_)return-1;if(c.arraycopy(l,0,t,a,h),u=-1,b=0,0!=f){var p=s(1);if(p[0]=e.nMusicCRC,o.updateMusicCRC(p,t,a,h),e.nMusicCRC=p[0],h>0&&(e.VBR_seek_table.nBytesWritten+=h),e.decode_on_the_fly)for(var m,v=i([2,1152]),g=h,S=-1;0!=S;)if(S=r.hip_decode1_unclipped(e.hip,t,a,g,v[0],v[1]),g=0,-1==S&&(S=0),S>0){if(e.findPeakSample){for(m=0;m<S;m++)v[0][m]>e.PeakSample?e.PeakSample=v[0][m]:-v[0][m]>e.PeakSample&&(e.PeakSample=-v[0][m]);if(e.channels_out>1)for(m=0;m<S;m++)v[1][m]>e.PeakSample?e.PeakSample=v[1][m]:-v[1][m]>e.PeakSample&&(e.PeakSample=-v[1][m])}if(e.findReplayGain&&n.AnalyzeSamples(e.rgdata,v[0],0,v[1],0,S,e.channels_out)==d.GAIN_ANALYSIS_ERROR)return-6}}return h},this.init_bit_stream_w=function(t){l=e(V.LAME_MAXMP3BUFFER),t.h_ptr=t.w_ptr=0,t.header[t.h_ptr].write_timing=0,u=-1,b=0,h=0}}function S(){var t,a,s;this.setModules=function(e,n,r){t=e,a=n,s=r};var n=S.NUMTOCENTRIES,r=S.MAXFRAMESIZE,i=n+4+4+4+4+4+9+1+1+8+1+1+3+1+1+2+4+2+2,_=128,o=64,l=32,h=null,b="Xing",m="Info",d=[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];function v(e,t){var a=255&e[t+0];return a<<=8,a|=255&e[t+1],a<<=8,a|=255&e[t+2],a<<=8,a|=255&e[t+3]}function g(e,t,a){e[t+0]=255&a>>24,e[t+1]=255&a>>16,e[t+2]=255&a>>8,e[t+3]=255&a}function R(e,t,a){e[t+0]=255&a>>8,e[t+1]=255&a}function A(e,t,a){return 255&(e<<t|a&~(-1<<t))}function B(e,a){var s=e.internal_flags;a[0]=A(a[0],8,255),a[1]=A(a[1],3,7),a[1]=A(a[1],1,e.out_samplerate<16e3?0:1),a[1]=A(a[1],1,e.version),a[1]=A(a[1],2,1),a[1]=A(a[1],1,e.error_protection?0:1),a[2]=A(a[2],4,s.bitrate_index),a[2]=A(a[2],2,s.samplerate_index),a[2]=A(a[2],1,0),a[2]=A(a[2],1,e.extension),a[3]=A(a[3],2,e.mode.ordinal()),a[3]=A(a[3],2,s.mode_ext),a[3]=A(a[3],1,e.copyright),a[3]=A(a[3],1,e.original),a[3]=A(a[3],2,e.emphasis),a[0]=255;var n,r,i=241&a[1];n=1==e.version?_:e.out_samplerate<16e3?l:o,e.VBR==p.vbr_off&&(n=e.brate),r=e.free_format?0:255&16*t.BitrateIndex(n,e.version,e.out_samplerate),1==e.version?(a[1]=255&(10|i),i=13&a[2],a[2]=255&(r|i)):(a[1]=255&(2|i),i=13&a[2],a[2]=255&(r|i))}function w(e,t){return t=t>>8^d[255&(t^e)]}this.addVbrFrame=function(e){var t=e.internal_flags,a=M.bitrate_table[e.version][t.bitrate_index];!function(e,t){if(e.nVbrNumFrames++,e.sum+=t,e.seen++,!(e.seen<e.want)&&(e.pos<e.size&&(e.bag[e.pos]=e.sum,e.pos++,e.seen=0),e.pos==e.size)){for(var a=1;a<e.size;a+=2)e.bag[a/2]=e.bag[a];e.want*=2,e.pos/=2}}(t.VBR_seek_table,a)},this.getVbrTag=function(e){var t=new VBRTagData,a=0;t.flags=0;var s=e[a+1]>>3&1,r=e[a+2]>>2&3,i=e[a+3]>>6&3,_=e[a+2]>>4&15;if(_=M.bitrate_table[s][_],e[a+1]>>4==14?t.samprate=M.samplerate_table[2][r]:t.samprate=M.samplerate_table[s][r],!function(e,t){return new String(e,t,b.length(),h).equals(b)||new String(e,t,m.length(),h).equals(m)}(e,a+=0!=s?3!=i?36:21:3!=i?21:13))return null;a+=4,t.hId=s;var o=t.flags=v(e,a);if(a+=4,0!=(1&o)&&(t.frames=v(e,a),a+=4),0!=(2&o)&&(t.bytes=v(e,a),a+=4),0!=(4&o)){if(null!=t.toc)for(var l=0;l<n;l++)t.toc[l]=e[a+l];a+=n}t.vbrScale=-1,0!=(8&o)&&(t.vbrScale=v(e,a),a+=4),t.headersize=72e3*(s+1)*_/t.samprate;var f=e[(a+=21)+0]<<4;f+=e[a+1]>>4;var c=(15&e[a+1])<<8;return(f<0||f>3e3)&&(f=-1),((c+=255&e[a+2])<0||c>3e3)&&(c=-1),t.encDelay=f,t.encPadding=c,t},this.InitVbrTag=function(t){var s,n=t.internal_flags;s=1==t.version?_:t.out_samplerate<16e3?l:o,t.VBR==p.vbr_off&&(s=t.brate);var f=72e3*(t.version+1)*s/t.out_samplerate,c=n.sideinfo_len+i;if(n.VBR_seek_table.TotalFrameSize=f,f<c||f>r)t.bWriteVbrTag=!1;else{n.VBR_seek_table.nVbrNumFrames=0,n.VBR_seek_table.nBytesWritten=0,n.VBR_seek_table.sum=0,n.VBR_seek_table.seen=0,n.VBR_seek_table.want=1,n.VBR_seek_table.pos=0,null==n.VBR_seek_table.bag&&(n.VBR_seek_table.bag=new int[400],n.VBR_seek_table.size=400);var h=e(r);B(t,h);for(var u=n.VBR_seek_table.TotalFrameSize,b=0;b<u;++b)a.add_dummy_byte(t,255&h[b],1)}},this.updateMusicCRC=function(e,t,a,s){for(var n=0;n<s;++n)e[0]=w(t[a+n],e[0])},this.getLameTagFrame=function(t,r){var i=t.internal_flags;if(!t.bWriteVbrTag)return 0;if(i.Class_ID!=V.LAME_ID)return 0;if(i.VBR_seek_table.pos<=0)return 0;if(r.length<i.VBR_seek_table.TotalFrameSize)return i.VBR_seek_table.TotalFrameSize;f.fill(r,0,i.VBR_seek_table.TotalFrameSize,0),B(t,r);var _=e(n);if(t.free_format)for(var o=1;o<n;++o)_[o]=255&255*o/100;else!function(e,t){if(!(e.pos<=0))for(var a=1;a<n;++a){var s=a/n,r=0|Math.floor(s*e.pos);r>e.pos-1&&(r=e.pos-1);var i=0|256*e.bag[r]/e.sum;i>255&&(i=255),t[a]=255&i}}(i.VBR_seek_table,_);var l=i.sideinfo_len;t.error_protection&&(l-=2),t.VBR==p.vbr_off?(r[l++]=255&m.charAt(0),r[l++]=255&m.charAt(1),r[l++]=255&m.charAt(2),r[l++]=255&m.charAt(3)):(r[l++]=255&b.charAt(0),r[l++]=255&b.charAt(1),r[l++]=255&b.charAt(2),r[l++]=255&b.charAt(3)),g(r,l,15),g(r,l+=4,i.VBR_seek_table.nVbrNumFrames),l+=4;var h=i.VBR_seek_table.nBytesWritten+i.VBR_seek_table.TotalFrameSize;g(r,l,0|h),l+=4,c.arraycopy(_,0,r,l,_.length),l+=_.length,t.error_protection&&a.CRC_writeheader(i,r);var d=0;for(o=0;o<l;o++)d=w(r[o],d);return l+=function(e,t,a,n,r){var i,_,o,l,f,c=e.internal_flags,h=0,b=e.encoder_delay,p=e.encoder_padding,m=100-10*e.VBR_q-e.quality,d=s.getLameVeryShortVersion(),v=[1,5,3,2,4,0,3],S=0|(e.lowpassfreq/100+.5>255?255:e.lowpassfreq/100+.5),M=0,A=0,B=e.internal_flags.noise_shaping,T=0,E=0,y=0,k=0!=(1&e.exp_nspsytune),x=0!=(2&e.exp_nspsytune),P=!1,I=!1,H=e.internal_flags.nogap_total,O=e.internal_flags.nogap_current,V=e.ATHtype;switch(e.VBR){case vbr_abr:f=e.VBR_mean_bitrate_kbps;break;case vbr_off:f=e.brate;break;default:f=e.VBR_min_bitrate_kbps}switch(i=0+(e.VBR.ordinal()<v.length?v[e.VBR.ordinal()]:0),c.findReplayGain&&(c.RadioGain>510&&(c.RadioGain=510),c.RadioGain<-510&&(c.RadioGain=-510),A=8192,A|=3072,c.RadioGain>=0?A|=c.RadioGain:(A|=512,A|=-c.RadioGain)),c.findPeakSample&&(M=Math.abs(0|c.PeakSample/32767*Math.pow(2,23)+.5)),-1!=H&&(O>0&&(I=!0),O<H-1&&(P=!0)),l=V+((k?1:0)<<4)+((x?1:0)<<5)+((P?1:0)<<6)+((I?1:0)<<7),m<0&&(m=0),e.mode){case MONO:T=0;break;case STEREO:T=1;break;case DUAL_CHANNEL:T=2;break;case JOINT_STEREO:T=e.force_ms?4:3;break;case NOT_SET:default:T=7}y=e.in_samplerate<=32e3?0:48e3==e.in_samplerate?2:e.in_samplerate>48e3?3:1,(e.short_blocks==u.short_block_forced||e.short_blocks==u.short_block_dispensed||-1==e.lowpassfreq&&-1==e.highpassfreq||e.scale_left<e.scale_right||e.scale_left>e.scale_right||e.disable_reservoir&&e.brate<320||e.noATH||e.ATHonly||0==V||e.in_samplerate<=32e3)&&(E=1),_=B+(T<<2)+(E<<5)+(y<<6),o=c.nMusicCRC,g(a,n+h,m),h+=4;for(var L=0;L<9;L++)a[n+h+L]=255&d.charAt(L);a[n+(h+=9)]=255&i,a[n+ ++h]=255&S,g(a,n+ ++h,M),R(a,n+(h+=4),A),R(a,n+(h+=2),0),a[n+(h+=2)]=255&l,a[n+ ++h]=f>=255?255:255&f,a[n+ ++h]=255&b>>4,a[n+h+1]=255&(b<<4)+(p>>8),a[n+h+2]=255&p,a[n+(h+=3)]=255&_,h++,a[n+h++]=0,R(a,n+h,e.preset),g(a,n+(h+=2),t),R(a,n+(h+=4),o),h+=2;for(var N=0;N<h;N++)r=w(a[n+N],r);return R(a,n+h,r),h+=2}(t,h,r,l,d),i.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(t,a){if(t.internal_flags.VBR_seek_table.pos<=0)return-1;if(a.seek(a.length()),0==a.length())return-1;var s=function(t){t.seek(0);var a=e(10);return t.readFully(a),new String(a,"ISO-8859-1").startsWith("ID3")?0:((127&a[6])<<21|(127&a[7])<<14|(127&a[8])<<7|127&a[9])+a.length}(a);a.seek(s);var n=e(r),i=getLameTagFrame(t,n);return i>n.length?-1:i<1?0:(a.write(n,0,i),0)}}function R(e,t,a,s){this.xlen=e,this.linmax=t,this.table=a,this.hlen=s}m.STEREO=new m(0),m.JOINT_STEREO=new m(1),m.DUAL_CHANNEL=new m(2),m.MONO=new m(3),m.NOT_SET=new m(4),d.STEPS_per_dB=100,d.MAX_dB=120,d.GAIN_NOT_ENOUGH_SAMPLES=-24601,d.GAIN_ANALYSIS_ERROR=0,d.GAIN_ANALYSIS_OK=1,d.INIT_GAIN_ANALYSIS_ERROR=0,d.INIT_GAIN_ANALYSIS_OK=1,d.YULE_ORDER=10,d.MAX_ORDER=d.YULE_ORDER,d.MAX_SAMP_FREQ=48e3,d.RMS_WINDOW_TIME_NUMERATOR=1,d.RMS_WINDOW_TIME_DENOMINATOR=20,d.MAX_SAMPLES_PER_WINDOW=d.MAX_SAMP_FREQ*d.RMS_WINDOW_TIME_NUMERATOR/d.RMS_WINDOW_TIME_DENOMINATOR+1,g.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)},g.NEQ=function(e,t){return!g.EQ(e,t)},S.NUMTOCENTRIES=100,S.MAXFRAMESIZE=2880;var M={};function A(e){this.bits=e}function B(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}function w(e,t,a,n){this.l=s(1+P.SBMAX_l),this.s=s(1+P.SBMAX_s),this.psfb21=s(1+P.PSFB21),this.psfb12=s(1+P.PSFB12);var r=this.l,i=this.s;4==arguments.length&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],c.arraycopy(this.arrL,0,r,0,Math.min(this.arrL.length,this.l.length)),c.arraycopy(this.arrS,0,i,0,Math.min(this.arrS.length,this.s.length)),c.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),c.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}function T(){var e=null,t=null,a=null;this.setModules=function(s,n,r){e=s,t=n,a=r},this.IPOW20=function(e){return c[e]};var r=T.IXMAX_VAL+2,i=T.Q_MAX,_=T.Q_MAX2,o=(T.LARGE_BITS,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 l=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=l,this.sfBandIndex=[new w([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 w([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 w([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 w([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 w([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 w([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 w([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 w([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 w([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 f=n(i+_+1),c=n(i),u=n(r),m=n(r);function d(e,t){var s=a.ATHformula(t,e);return s-=o,s=Math.pow(10,s/10+e.ATHlower)}function v(e){this.s=e}this.adj43=m,this.iteration_init=function(t){var a,s=t.internal_flags,n=s.l3_side;if(0==s.iteration_init_init){for(s.iteration_init_init=1,n.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,_=0;_<P.SBMAX_l;_++){var o=r.scalefac_band.l[_],l=r.scalefac_band.l[_+1];t[_]=b.MAX_VALUE;for(var f=o;f<l;f++){var c=d(e,f*i/1152);t[_]=Math.min(t[_],c)}}for(_=0;_<P.PSFB21;_++)for(o=r.scalefac_band.psfb21[_],l=r.scalefac_band.psfb21[_+1],a[_]=b.MAX_VALUE,f=o;f<l;f++)c=d(e,f*i/1152),a[_]=Math.min(a[_],c);for(_=0;_<P.SBMAX_s;_++){for(o=r.scalefac_band.s[_],l=r.scalefac_band.s[_+1],s[_]=b.MAX_VALUE,f=o;f<l;f++)c=d(e,f*i/384),s[_]=Math.min(s[_],c);s[_]*=r.scalefac_band.s[_+1]-r.scalefac_band.s[_]}for(_=0;_<P.PSFB12;_++){for(o=r.scalefac_band.psfb12[_],l=r.scalefac_band.psfb12[_+1],n[_]=b.MAX_VALUE,f=o;f<l;f++)c=d(e,f*i/384),n[_]=Math.min(n[_],c);n[_]*=r.scalefac_band.s[13]-r.scalefac_band.s[12]}if(e.noATH){for(_=0;_<P.SBMAX_l;_++)t[_]=1e-20;for(_=0;_<P.PSFB21;_++)a[_]=1e-20;for(_=0;_<P.SBMAX_s;_++)s[_]=1e-20;for(_=0;_<P.PSFB12;_++)n[_]=1e-20}r.ATH.floor=10*Math.log10(d(e,-1))}(t),u[0]=0,a=1;a<r;a++)u[a]=Math.pow(a,4/3);for(a=0;a<r-1;a++)m[a]=a+1-Math.pow(.5*(u[a]+u[a+1]),.75);for(m[a]=.5,a=0;a<i;a++)c[a]=Math.pow(2,-.1875*(a-210));for(a=0;a<=i+_;a++)f[a]=Math.pow(2,.25*(a-210-_));var o,l,h,p;for(e.huffman_init(s),(a=t.exp_nspsytune>>2&63)>=32&&(a-=64),o=Math.pow(10,a/4/10),(a=t.exp_nspsytune>>8&63)>=32&&(a-=64),l=Math.pow(10,a/4/10),(a=t.exp_nspsytune>>14&63)>=32&&(a-=64),h=Math.pow(10,a/4/10),(a=t.exp_nspsytune>>20&63)>=32&&(a-=64),p=h*Math.pow(10,a/4/10),a=0;a<P.SBMAX_l;a++){v=a<=6?o:a<=13?l:a<=20?h:p,s.nsPsy.longfact[a]=v}for(a=0;a<P.SBMAX_s;a++){var v;v=a<=5?o:a<=10?l:a<=11?h:p,s.nsPsy.shortfact[a]=v}}},this.on_pe=function(e,a,n,r,i,_){var o,l,f=e.internal_flags,c=0,h=s(2),u=new A(c),b=t.ResvMaxBits(e,r,u,_),p=(c=u.bits)+b;for(p>H.MAX_BITS_PER_GRANULE&&(p=H.MAX_BITS_PER_GRANULE),o=0,l=0;l<f.channels_out;++l)n[l]=Math.min(H.MAX_BITS_PER_CHANNEL,c/f.channels_out),h[l]=0|n[l]*a[i][l]/700-n[l],h[l]>3*r/4&&(h[l]=3*r/4),h[l]<0&&(h[l]=0),h[l]+n[l]>H.MAX_BITS_PER_CHANNEL&&(h[l]=Math.max(0,H.MAX_BITS_PER_CHANNEL-n[l])),o+=h[l];if(o>b)for(l=0;l<f.channels_out;++l)h[l]=b*h[l]/o;for(l=0;l<f.channels_out;++l)n[l]+=h[l],b-=h[l];for(o=0,l=0;l<f.channels_out;++l)o+=n[l];if(o>H.MAX_BITS_PER_GRANULE){for(l=0;l<f.channels_out;++l)n[l]*=H.MAX_BITS_PER_GRANULE,n[l]/=o,n[l]}return p},this.reduce_side=function(e,t,a,s){var n=.33*(.5-t)/.5;n<0&&(n=0),n>.5&&(n=.5);var r=0|.5*n*(e[0]+e[1]);r>H.MAX_BITS_PER_CHANNEL-e[0]&&(r=H.MAX_BITS_PER_CHANNEL-e[0]),r<0&&(r=0),e[1]>=125&&(e[1]-r>125?(e[0]<a&&(e[0]+=r),e[1]-=r):(e[0]+=e[1]-125,e[1]=125)),(r=e[0]+e[1])>s&&(e[0]=s*e[0]/r,e[1]=s*e[1]/r)},this.athAdjust=function(e,t,a){var s=90.30873362,n=h.FAST_LOG10_X(t,10),r=e*e,i=0;return n-=a,r>1e-20&&(i=1+h.FAST_LOG10_X(r,10/s)),i<0&&(i=0),n*=i,n+=a+s-94.82444863,Math.pow(10,.1*n)},this.calc_xmin=function(e,t,a,s){var n,r=0,i=e.internal_flags,_=0,o=0,l=i.ATH,f=a.xr,c=e.VBR==p.vbr_mtrh?1:0,h=i.masking_lower;for(e.VBR!=p.vbr_mtrh&&e.VBR!=p.vbr_mt||(h=1),n=0;n<a.psy_lmax;n++){M=(R=e.VBR==p.vbr_rh||e.VBR==p.vbr_mtrh?athAdjust(l.adjust,l.l[n],l.floor):l.adjust*l.l[n])/(d=a.width[n]),A=2.220446049250313e-16,E=d>>1,T=0;do{T+=y=f[_]*f[_],A+=y<M?y:M,T+=k=f[++_]*f[_],A+=k<M?k:M,_++}while(--E>0);if(T>R&&o++,n==P.SBPSY_l)A<(w=R*i.nsPsy.longfact[n])&&(A=w);if(0!=c&&(R=A),!e.ATHonly)if((B=t.en.l[n])>0)w=T*t.thm.l[n]*h/B,0!=c&&(w*=i.nsPsy.longfact[n]),R<w&&(R=w);s[r++]=0!=c?R:R*i.nsPsy.longfact[n]}var u=575;if(a.block_type!=P.SHORT_TYPE)for(var b=576;0!=b--&&g.EQ(f[b],0);)u=b;a.max_nonzero_coeff=u;for(var m=a.sfb_smin;n<a.psymax;m++,n+=3){var d,v,S;for(S=e.VBR==p.vbr_rh||e.VBR==p.vbr_mtrh?athAdjust(l.adjust,l.s[m],l.floor):l.adjust*l.s[m],d=a.width[n],v=0;v<3;v++){var R,M,A,B,w,T=0,E=d>>1;M=S/d,A=2.220446049250313e-16;do{var y,k;T+=y=f[_]*f[_],A+=y<M?y:M,T+=k=f[++_]*f[_],A+=k<M?k:M,_++}while(--E>0);if(T>S&&o++,m==P.SBPSY_s)A<(w=S*i.nsPsy.shortfact[m])&&(A=w);if(R=0!=c?A:S,!e.ATHonly&&!e.ATHshort)if((B=t.en.s[m][v])>0)w=T*t.thm.s[m][v]*h/B,0!=c&&(w*=i.nsPsy.shortfact[m]),R<w&&(R=w);s[r++]=0!=c?R:R*i.nsPsy.shortfact[m]}e.useTemporal&&(s[r-3]>s[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 o},this.calc_noise_core=function(e,t,a,s){var r=0,i=t.s,_=e.l3_enc;if(i>e.count1)for(;0!=a--;){l=e.xr[i],i++,r+=l*l,l=e.xr[i],i++,r+=l*l}else if(i>e.big_values){var o=n(2);for(o[0]=0,o[1]=s;0!=a--;){l=Math.abs(e.xr[i])-o[_[i]],i++,r+=l*l,l=Math.abs(e.xr[i])-o[_[i]],i++,r+=l*l}}else for(;0!=a--;){var l;l=Math.abs(e.xr[i])-u[_[i]]*s,i++,r+=l*l,l=Math.abs(e.xr[i])-u[_[i]]*s,i++,r+=l*l}return t.s=i,r},this.calc_noise=function(e,t,a,s,n){var r,i,_=0,o=0,c=0,u=0,b=0,p=-20,m=0,d=e.scalefac,g=0;for(s.over_SSD=0,r=0;r<e.psymax;r++){var S,R=e.global_gain-(d[g++]+(0!=e.preflag?l[r]:0)<<e.scalefac_scale+1)-8*e.subblock_gain[e.window[r]],M=0;if(null!=n&&n.step[r]==R)M=n.noise[r],m+=e.width[r],a[_++]=M/t[o++],M=n.noise_log[r];else{var A,B=f[R+T.Q_MAX2];if(i=e.width[r]>>1,m+e.width[r]>e.max_nonzero_coeff)i=(A=e.max_nonzero_coeff-m+1)>0?A>>1:0;var w=new v(m);M=this.calc_noise_core(e,w,i,B),m=w.s,null!=n&&(n.step[r]=R,n.noise[r]=M),M=a[_++]=M/t[o++],M=h.FAST_LOG10(Math.max(M,1e-20)),null!=n&&(n.noise_log[r]=M)}if(null!=n&&(n.global_gain=e.global_gain),b+=M,M>0)S=Math.max(0|10*M+.5,1),s.over_SSD+=S*S,c++,u+=M;p=Math.max(p,M)}return s.over_count=c,s.tot_noise=b,s.over_noise=u,s.max_noise=p,c},this.set_pinfo=function(e,t,a,s,r){var i,_,o,f,c,h=e.internal_flags,u=0==t.scalefac_scale?.5:1,b=t.scalefac,p=n(y.SFBMAX),m=n(y.SFBMAX),d=new B;calc_xmin(e,a,t,p),calc_noise(t,p,m,d,null);var v=0;for(_=t.sfb_lmax,t.block_type!=P.SHORT_TYPE&&0==t.mixed_block_flag&&(_=22),i=0;i<_;i++){var g=h.scalefac_band.l[i],S=(R=h.scalefac_band.l[i+1])-g;for(f=0;v<R;v++)f+=t.xr[v]*t.xr[v];f/=S,c=1e15,h.pinfo.en[s][r][i]=c*f,h.pinfo.xfsf[s][r][i]=c*p[i]*m[i]/S,a.en.l[i]>0&&!e.ATHonly?f/=a.en.l[i]:f=0,h.pinfo.thr[s][r][i]=c*Math.max(f*a.thm.l[i],h.ATH.l[i]),h.pinfo.LAMEsfb[s][r][i]=0,0!=t.preflag&&i>=11&&(h.pinfo.LAMEsfb[s][r][i]=-u*l[i]),i<P.SBPSY_l&&(h.pinfo.LAMEsfb[s][r][i]-=u*b[i])}if(t.block_type==P.SHORT_TYPE)for(_=i,i=t.sfb_smin;i<P.SBMAX_s;i++){g=h.scalefac_band.s[i],S=(R=h.scalefac_band.s[i+1])-g;for(var R,M=0;M<3;M++){for(f=0,o=g;o<R;o++)f+=t.xr[v]*t.xr[v],v++;f=Math.max(f/S,1e-20),c=1e15,h.pinfo.en_s[s][r][3*i+M]=c*f,h.pinfo.xfsf_s[s][r][3*i+M]=c*p[_]*m[_]/S,a.en.s[i][M]>0?f/=a.en.s[i][M]:f=0,(e.ATHonly||e.ATHshort)&&(f=0),h.pinfo.thr_s[s][r][3*i+M]=c*Math.max(f*a.thm.s[i][M],h.ATH.s[i]),h.pinfo.LAMEsfb_s[s][r][3*i+M]=-2*t.subblock_gain[M],i<P.SBPSY_s&&(h.pinfo.LAMEsfb_s[s][r][3*i+M]-=u*b[_]),_++}}h.pinfo.LAMEqss[s][r]=t.global_gain,h.pinfo.LAMEmainbits[s][r]=t.part2_3_length+t.part2_length,h.pinfo.LAMEsfbits[s][r]=t.part2_length,h.pinfo.over[s][r]=d.over_count,h.pinfo.max_noise[s][r]=10*d.max_noise,h.pinfo.over_noise[s][r]=10*d.over_noise,h.pinfo.tot_noise[s][r]=10*d.tot_noise,h.pinfo.over_SSD[s][r]=d.over_SSD}}function E(){this.xr=n(576),this.l3_enc=s(576),this.scalefac=s(y.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=s(3),this.subblock_gain=s(4),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=s(y.SFBMAX),this.window=s(y.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=s(4),this.max_nonzero_coeff=0;var e=this;function t(e){return new Int32Array(e)}this.assign=function(a){var s;e.xr=(s=a.xr,new Float32Array(s)),e.l3_enc=t(a.l3_enc),e.scalefac=t(a.scalefac),e.xrpow_max=a.xrpow_max,e.part2_3_length=a.part2_3_length,e.big_values=a.big_values,e.count1=a.count1,e.global_gain=a.global_gain,e.scalefac_compress=a.scalefac_compress,e.block_type=a.block_type,e.mixed_block_flag=a.mixed_block_flag,e.table_select=t(a.table_select),e.subblock_gain=t(a.subblock_gain),e.region0_count=a.region0_count,e.region1_count=a.region1_count,e.preflag=a.preflag,e.scalefac_scale=a.scalefac_scale,e.count1table_select=a.count1table_select,e.part2_length=a.part2_length,e.sfb_lmax=a.sfb_lmax,e.sfb_smin=a.sfb_smin,e.psy_lmax=a.psy_lmax,e.sfbmax=a.sfbmax,e.psymax=a.psymax,e.sfbdivide=a.sfbdivide,e.width=t(a.width),e.window=t(a.window),e.count1bits=a.count1bits,e.sfb_partition_table=a.sfb_partition_table.slice(0),e.slen=t(a.slen),e.max_nonzero_coeff=a.max_nonzero_coeff}}M.t1HB=[1,1,1,0],M.t2HB=[1,2,1,3,1,1,3,2,0],M.t3HB=[3,2,1,1,1,1,3,2,0],M.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],M.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],M.t7HB=[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],M.t8HB=[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],M.t9HB=[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],M.t10HB=[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],M.t11HB=[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],M.t12HB=[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],M.t13HB=[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],M.t15HB=[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],M.t16HB=[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],M.t24HB=[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],M.t32HB=[1,10,8,20,12,20,16,32,14,12,24,0,28,16,24,16],M.t33HB=[15,28,26,48,22,40,36,64,14,24,20,32,12,16,8,0],M.t1l=[1,4,3,5],M.t2l=[1,4,7,4,5,7,6,7,8],M.t3l=[2,3,7,4,4,7,6,7,8],M.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],M.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],M.t7l=[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],M.t8l=[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],M.t9l=[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],M.t10l=[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],M.t11l=[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],M.t12l=[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],M.t13l=[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],M.t15l=[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],M.t16_5l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],M.t16l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],M.t24l=[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],M.t32l=[1,5,5,7,5,8,7,9,5,7,7,9,7,9,9,10],M.t33l=[4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8],M.ht=[new R(0,0,null,null),new R(2,0,M.t1HB,M.t1l),new R(3,0,M.t2HB,M.t2l),new R(3,0,M.t3HB,M.t3l),new R(0,0,null,null),new R(4,0,M.t5HB,M.t5l),new R(4,0,M.t6HB,M.t6l),new R(6,0,M.t7HB,M.t7l),new R(6,0,M.t8HB,M.t8l),new R(6,0,M.t9HB,M.t9l),new R(8,0,M.t10HB,M.t10l),new R(8,0,M.t11HB,M.t11l),new R(8,0,M.t12HB,M.t12l),new R(16,0,M.t13HB,M.t13l),new R(0,0,null,M.t16_5l),new R(16,0,M.t15HB,M.t15l),new R(1,1,M.t16HB,M.t16l),new R(2,3,M.t16HB,M.t16l),new R(3,7,M.t16HB,M.t16l),new R(4,15,M.t16HB,M.t16l),new R(6,63,M.t16HB,M.t16l),new R(8,255,M.t16HB,M.t16l),new R(10,1023,M.t16HB,M.t16l),new R(13,8191,M.t16HB,M.t16l),new R(4,15,M.t24HB,M.t24l),new R(5,31,M.t24HB,M.t24l),new R(6,63,M.t24HB,M.t24l),new R(7,127,M.t24HB,M.t24l),new R(8,255,M.t24HB,M.t24l),new R(9,511,M.t24HB,M.t24l),new R(11,2047,M.t24HB,M.t24l),new R(13,8191,M.t24HB,M.t24l),new R(0,0,M.t32HB,M.t32l),new R(0,0,M.t33HB,M.t33l)],M.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],M.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],M.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],M.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],M.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],M.scfsi_band=[0,6,11,16,21],T.Q_MAX=257,T.Q_MAX2=116,T.LARGE_BITS=1e5,T.IXMAX_VAL=8206;var y={};function k(){var e,t,a;this.rv=null,this.qupvt=null;var r,i=new function(){this.setModules=function(e,t){}};function _(e){this.ordinal=e}function o(e){for(var t=0;t<e.sfbmax;t++)if(e.scalefac[t]+e.subblock_gain[e.window[t]]==0)return!1;return!0}function l(e,t,a,s,n){var r;switch(e){default:case 9:t.over_count>0?(r=a.over_SSD<=t.over_SSD,a.over_SSD==t.over_SSD&&(r=a.bits<t.bits)):r=a.max_noise<0&&10*a.max_noise+a.bits<=10*t.max_noise+t.bits;break;case 0:r=a.over_count<t.over_count||a.over_count==t.over_count&&a.over_noise<t.over_noise||a.over_count==t.over_count&&g.EQ(a.over_noise,t.over_noise)&&a.tot_noise<t.tot_noise;break;case 8:a.max_noise=function(e,t){for(var a,s=1e-37,n=0;n<t.psymax;n++)s+=(a=e[n],h.FAST_LOG10(.368+.632*a*a*a));return Math.max(1e-20,s)}(n,s);case 1:r=a.max_noise<t.max_noise;break;case 2:r=a.tot_noise<t.tot_noise;break;case 3:r=a.tot_noise<t.tot_noise&&a.max_noise<t.max_noise;break;case 4:r=a.max_noise<=0&&t.max_noise>.2||a.max_noise<=0&&t.max_noise<0&&t.max_noise>a.max_noise-.2&&a.tot_noise<t.tot_noise||a.max_noise<=0&&t.max_noise>0&&t.max_noise>a.max_noise-.2&&a.tot_noise<t.tot_noise+t.over_noise||a.max_noise>0&&t.max_noise>-.05&&t.max_noise>a.max_noise-.1&&a.tot_noise+a.over_noise<t.tot_noise+t.over_noise||a.max_noise>0&&t.max_noise>-.1&&t.max_noise>a.max_noise-.15&&a.tot_noise+a.over_noise+a.over_noise<t.tot_noise+t.over_noise+t.over_noise;break;case 5:r=a.over_noise<t.over_noise||g.EQ(a.over_noise,t.over_noise)&&a.tot_noise<t.tot_noise;break;case 6:r=a.over_noise<t.over_noise||g.EQ(a.over_noise,t.over_noise)&&(a.max_noise<t.max_noise||g.EQ(a.max_noise,t.max_noise)&&a.tot_noise<=t.tot_noise);break;case 7:r=a.over_count<t.over_count||a.over_noise<t.over_noise}return 0==t.over_count&&(r=r&&a.bits<t.bits),r}function u(e,t,s,n,i){var _=e.internal_flags;!function(e,t,a,s,n){var r,i=e.internal_flags;r=0==t.scalefac_scale?1.2968395546510096:1.6817928305074292;for(var _=0,o=0;o<t.sfbmax;o++)_<a[o]&&(_=a[o]);var l=i.noise_shaping_amp;switch(3==l&&(l=n?2:1),l){case 2:break;case 1:_>1?_=Math.pow(_,.5):_*=.95;break;case 0:default:_>1?_=1:_*=.95}var f=0;for(o=0;o<t.sfbmax;o++){var c,h=t.width[o];if(f+=h,!(a[o]<_)){if(0!=(2&i.substep_shaping)&&(i.pseudohalf[o]=0==i.pseudohalf[o]?1:0,0==i.pseudohalf[o]&&2==i.noise_shaping_amp))return;for(t.scalefac[o]++,c=-h;c<0;c++)s[f+c]*=r,s[f+c]>t.xrpow_max&&(t.xrpow_max=s[f+c]);if(2==i.noise_shaping_amp)return}}}(e,t,s,n,i);var l=o(t);return!l&&(!(l=2==_.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(_,t))||(_.noise_shaping>1&&(f.fill(_.pseudohalf,0),0==t.scalefac_scale?(!function(e,t){for(var s=0,n=0;n<e.sfbmax;n++){var r=e.width[n],i=e.scalefac[n];if(0!=e.preflag&&(i+=a.pretab[n]),s+=r,0!=(1&i)){i++;for(var _=-r;_<0;_++)t[s+_]*=1.2968395546510096,t[s+_]>e.xrpow_max&&(e.xrpow_max=t[s+_])}e.scalefac[n]=i>>1}e.preflag=0,e.scalefac_scale=1}(t,n),l=!1):t.block_type==P.SHORT_TYPE&&_.subblock_gain>0&&(l=function(e,t,s){var n,r=t.scalefac;for(n=0;n<t.sfb_lmax;n++)if(r[n]>=16)return!0;for(var i=0;i<3;i++){var _=0,o=0;for(n=t.sfb_lmax+i;n<t.sfbdivide;n+=3)_<r[n]&&(_=r[n]);for(;n<t.sfbmax;n+=3)o<r[n]&&(o=r[n]);if(!(_<16&&o<8)){if(t.subblock_gain[i]>=7)return!0;t.subblock_gain[i]++;var l=e.scalefac_band.l[t.sfb_lmax];for(n=t.sfb_lmax+i;n<t.sfbmax;n+=3){var f=t.width[n],c=r[n];if((c-=4>>t.scalefac_scale)>=0)r[n]=c,l+=3*f;else{r[n]=0;var h=210+(c<<t.scalefac_scale+1);b=a.IPOW20(h),l+=f*(i+1);for(var u=-f;u<0;u++)s[l+u]*=b,s[l+u]>t.xrpow_max&&(t.xrpow_max=s[l+u]);l+=f*(3-i-1)}}var b=a.IPOW20(202);for(l+=t.width[n]*(i+1),u=-t.width[n];u<0;u++)s[l+u]*=b,s[l+u]>t.xrpow_max&&(t.xrpow_max=s[l+u])}}return!1}(_,t,n)||o(t))),l||(l=2==_.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(_,t)),!l))}this.setModules=function(s,n,_,o){e=s,t=n,this.rv=n,a=_,this.qupvt=_,r=o,i.setModules(a,r)},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*h.SQRT2),e.tt[t][1].xr[a]=(s-n)*(.5*h.SQRT2)}},this.init_xrpow=function(e,t,a){var s=0,n=0|t.max_nonzero_coeff;if(t.xrpow_max=0,f.fill(a,n,576,0),(s=function(e,t,a,s){s=0;for(var n=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))>1e-20){var r=0;0!=(2&e.substep_shaping)&&(r=1);for(var i=0;i<t.psymax;i++)e.pseudohalf[i]=r;return!0}return f.fill(t.l3_enc,0,576,0),!1},this.init_outer_loop=function(e,t){t.part2_3_length=0,t.big_values=0,t.count1=0,t.global_gain=210,t.scalefac_compress=0,t.table_select[0]=0,t.table_select[1]=0,t.table_select[2]=0,t.subblock_gain[0]=0,t.subblock_gain[1]=0,t.subblock_gain[2]=0,t.subblock_gain[3]=0,t.region0_count=0,t.region1_count=0,t.preflag=0,t.scalefac_scale=0,t.count1table_select=0,t.part2_length=0,t.sfb_lmax=P.SBPSY_l,t.sfb_smin=P.SBPSY_s,t.psy_lmax=e.sfb21_extra?P.SBMAX_l:P.SBPSY_l,t.psymax=t.psy_lmax,t.sfbmax=t.sfb_lmax,t.sfbdivide=11;for(var s=0;s<P.SBMAX_l;s++)t.width[s]=e.scalefac_band.l[s+1]-e.scalefac_band.l[s],t.window[s]=3;if(t.block_type==P.SHORT_TYPE){var r=n(576);t.sfb_smin=0,t.sfb_lmax=0,0!=t.mixed_block_flag&&(t.sfb_smin=3,t.sfb_lmax=2*e.mode_gr+4),t.psymax=t.sfb_lmax+3*((e.sfb21_extra?P.SBMAX_s:P.SBPSY_s)-t.sfb_smin),t.sfbmax=t.sfb_lmax+3*(P.SBPSY_s-t.sfb_smin),t.sfbdivide=t.sfbmax-18,t.psy_lmax=t.sfb_lmax;var i=e.scalefac_band.l[t.sfb_lmax];c.arraycopy(t.xr,0,r,0,576);for(s=t.sfb_smin;s<P.SBMAX_s;s++)for(var _=e.scalefac_band.s[s],o=e.scalefac_band.s[s+1],l=0;l<3;l++)for(var h=_;h<o;h++)t.xr[i++]=r[3*h+l];var u=t.sfb_lmax;for(s=t.sfb_smin;s<P.SBMAX_s;s++)t.width[u]=t.width[u+1]=t.width[u+2]=e.scalefac_band.s[s+1]-e.scalefac_band.s[s],t.window[u]=0,t.window[u+1]=1,t.window[u+2]=2,u+=3}t.count1bits=0,t.sfb_partition_table=a.nr_of_sfb_block[0][0],t.slen[0]=0,t.slen[1]=0,t.slen[2]=0,t.slen[3]=0,t.max_nonzero_coeff=575,f.fill(t.scalefac,0),function(e,t){var s=e.ATH,n=t.xr;if(t.block_type!=P.SHORT_TYPE)for(var r=!1,i=P.PSFB21-1;i>=0&&!r;i--){var _=e.scalefac_band.psfb21[i],o=e.scalefac_band.psfb21[i+1],l=a.athAdjust(s.adjust,s.psfb21[i],s.floor);e.nsPsy.longfact[21]>1e-12&&(l*=e.nsPsy.longfact[21]);for(var f=o-1;f>=_;f--){if(!(Math.abs(n[f])<l)){r=!0;break}n[f]=0}}else for(var c=0;c<3;c++)for(r=!1,i=P.PSFB12-1;i>=0&&!r;i--){o=(_=3*e.scalefac_band.s[12]+(e.scalefac_band.s[13]-e.scalefac_band.s[12])*c+(e.scalefac_band.psfb12[i]-e.scalefac_band.psfb12[0]))+(e.scalefac_band.psfb12[i+1]-e.scalefac_band.psfb12[i]);var h=a.athAdjust(s.adjust,s.psfb12[i],s.floor);for(e.nsPsy.shortfact[12]>1e-12&&(h*=e.nsPsy.shortfact[12]),f=o-1;f>=_;f--){if(!(Math.abs(n[f])<h)){r=!0;break}n[f]=0}}}(e,t)},_.BINSEARCH_NONE=new _(0),_.BINSEARCH_UP=new _(1),_.BINSEARCH_DOWN=new _(2),this.trancate_smallspectrums=function(e,t,s,i){var _=n(y.SFBMAX);if((0!=(4&e.substep_shaping)||t.block_type!=P.SHORT_TYPE)&&0==(128&e.substep_shaping)){a.calc_noise(t,s,_,new B,null);for(var o=0;o<576;o++){var l=0;0!=t.l3_enc[o]&&(l=Math.abs(t.xr[o])),i[o]=l}o=0;var c=8;t.block_type==P.SHORT_TYPE&&(c=6);do{var h,u,b,p,m=t.width[c];if(o+=m,!(_[c]>=1||(f.sort(i,o-m,m),g.EQ(i[o-1],0)))){h=(1-_[c])*s[c],u=0,p=0;do{var d;for(b=1;p+b<m&&!g.NEQ(i[p+o-m],i[p+o+b-m]);b++);if(h<(d=i[p+o-m]*i[p+o-m]*b)){0!=p&&(u=i[p+o-m-1]);break}h-=d,p+=b}while(p<m);if(!g.EQ(u,0))do{Math.abs(t.xr[o-m])<=u&&(t.l3_enc[o-m]=0)}while(--m>0)}}while(++c<t.psymax);t.part2_3_length=r.noquant_count_bits(e,t,null)}},this.outer_loop=function(e,t,i,o,f,h){var b=e.internal_flags,m=new E,d=n(576),v=n(y.SFBMAX),g=new B,S=new function(){this.global_gain=0,this.sfb_count1=0,this.step=s(39),this.noise=n(39),this.noise_log=n(39)},R=9999999,M=!1,A=!1,w=0;if(function(e,t,a,s,n){var i,o=e.CurrentStep[s],l=!1,f=e.OldValue[s],c=_.BINSEARCH_NONE;for(t.global_gain=f,a-=t.part2_length;;){var h;if(i=r.count_bits(e,n,t,null),1==o||i==a)break;i>a?(c==_.BINSEARCH_DOWN&&(l=!0),l&&(o/=2),c=_.BINSEARCH_UP,h=o):(c==_.BINSEARCH_UP&&(l=!0),l&&(o/=2),c=_.BINSEARCH_DOWN,h=-o),t.global_gain+=h,t.global_gain<0&&(t.global_gain=0,l=!0),t.global_gain>255&&(t.global_gain=255,l=!0)}for(;i>a&&t.global_gain<255;)t.global_gain++,i=r.count_bits(e,n,t,null);e.CurrentStep[s]=f-t.global_gain>=4?4:2,e.OldValue[s]=t.global_gain,t.part2_3_length=i}(b,t,h,f,o),0==b.noise_shaping)return 100;a.calc_noise(t,i,v,g,S),g.bits=t.part2_3_length,m.assign(t);var T=0;for(c.arraycopy(o,0,d,0,576);!M;){do{var k,x=new B,I=255;if(k=0!=(2&b.substep_shaping)?20:3,b.sfb21_extra){if(v[m.sfbmax]>1)break;if(m.block_type==P.SHORT_TYPE&&(v[m.sfbmax+1]>1||v[m.sfbmax+2]>1))break}if(!u(e,m,v,o,A))break;0!=m.scalefac_scale&&(I=254);var H=h-m.part2_length;if(H<=0)break;for(;(m.part2_3_length=r.count_bits(b,o,m,S))>H&&m.global_gain<=I;)m.global_gain++;if(m.global_gain>I)break;if(0==g.over_count){for(;(m.part2_3_length=r.count_bits(b,o,m,S))>R&&m.global_gain<=I;)m.global_gain++;if(m.global_gain>I)break}if(a.calc_noise(m,i,v,x,S),x.bits=m.part2_3_length,0!=(l(t.block_type!=P.SHORT_TYPE?e.quant_comp:e.quant_comp_short,g,x,m,v)?1:0))R=t.part2_3_length,g=x,t.assign(m),T=0,c.arraycopy(o,0,d,0,576);else if(0==b.full_outer_loop){if(++T>k&&0==g.over_count)break;if(3==b.noise_shaping_amp&&A&&T>30)break;if(3==b.noise_shaping_amp&&A&&m.global_gain-w>15)break}}while(m.global_gain+m.scalefac_scale<255);3==b.noise_shaping_amp?A?M=!0:(m.assign(t),c.arraycopy(d,0,o,0,576),T=0,w=m.global_gain,A=!0):M=!0}return e.VBR==p.vbr_rh||e.VBR==p.vbr_mtrh?c.arraycopy(d,0,o,0,576):0!=(1&b.substep_shaping)&&trancate_smallspectrums(b,t,i,o),g.over_count},this.iteration_finish_one=function(e,a,s){var n=e.l3_side,i=n.tt[a][s];r.best_scalefac_store(e,a,s,n),1==e.use_best_huffman&&r.best_huffman_divide(e,i),t.ResvAdjust(e,i)},this.VBR_encode_granule=function(e,t,a,s,r,i,_){var o,l=e.internal_flags,h=new E,u=n(576),b=_,p=_+1,m=(_+i)/2,d=0,v=l.sfb21_extra;f.fill(h.l3_enc,0);do{l.sfb21_extra=!(m>b-42)&&v,outer_loop(e,t,a,s,r,m)<=0?(d=1,p=t.part2_3_length,h.assign(t),c.arraycopy(s,0,u,0,576),o=(_=p-32)-i,m=(_+i)/2):(o=_-(i=m+32),m=(_+i)/2,0!=d&&(d=2,t.assign(h),c.arraycopy(u,0,s,0,576)))}while(o>12);l.sfb21_extra=v,2==d&&c.arraycopy(h.l3_enc,0,t.l3_enc,0,576)},this.get_framebits=function(a,s){var n=a.internal_flags;n.bitrate_index=n.VBR_min_bitrate;var r=e.getframebits(a);n.bitrate_index=1,r=e.getframebits(a);for(var i=1;i<=n.VBR_max_bitrate;i++){n.bitrate_index=i;var _=new A(r);s[i]=t.ResvFrameBegin(a,_),r=_.bits}},this.VBR_old_prepare=function(e,s,n,r,i,_,o,l,f){var c,h=e.internal_flags,u=0,b=1,p=0;h.bitrate_index=h.VBR_max_bitrate;var m=t.ResvFrameBegin(e,new A(0))/h.mode_gr;get_framebits(e,_);for(var d=0;d<h.mode_gr;d++){var v=a.on_pe(e,s,l[d],m,d,0);h.mode_ext==P.MPG_MD_MS_LR&&(ms_convert(h.l3_side,d),a.reduce_side(l[d],n[d],m,v));for(var g=0;g<h.channels_out;++g){var S=h.l3_side.tt[d][g];S.block_type!=P.SHORT_TYPE?(u=1.28/(1+Math.exp(3.5-s[d][g]/300))-.05,c=h.PSY.mask_adjust-u):(u=2.56/(1+Math.exp(3.5-s[d][g]/300))-.14,c=h.PSY.mask_adjust_short-u),h.masking_lower=Math.pow(10,.1*c),init_outer_loop(h,S),f[d][g]=a.calc_xmin(e,r[d][g],S,i[d][g]),0!=f[d][g]&&(b=0),o[d][g]=126,p+=l[d][g]}}for(d=0;d<h.mode_gr;d++)for(g=0;g<h.channels_out;g++)p>_[h.VBR_max_bitrate]&&(l[d][g]*=_[h.VBR_max_bitrate],l[d][g]/=p),o[d][g]>l[d][g]&&(o[d][g]=l[d][g]);return b},this.bitpressure_strategy=function(e,t,a,s){for(var n=0;n<e.mode_gr;n++)for(var r=0;r<e.channels_out;r++){for(var i=e.l3_side.tt[n][r],_=t[n][r],o=0,l=0;l<i.psy_lmax;l++)_[o++]*=1+.029*l*l/P.SBMAX_l/P.SBMAX_l;if(i.block_type==P.SHORT_TYPE)for(l=i.sfb_smin;l<P.SBMAX_s;l++)_[o++]*=1+.029*l*l/P.SBMAX_s/P.SBMAX_s,_[o++]*=1+.029*l*l/P.SBMAX_s/P.SBMAX_s,_[o++]*=1+.029*l*l/P.SBMAX_s/P.SBMAX_s;s[n][r]=0|Math.max(a[n][r],.9*s[n][r])}},this.VBR_new_prepare=function(e,s,n,r,i,_){var o,l=e.internal_flags,f=1,c=0,h=0;if(e.free_format){l.bitrate_index=0;u=new A(c);o=t.ResvFrameBegin(e,u),c=u.bits,i[0]=o}else{l.bitrate_index=l.VBR_max_bitrate;var u=new A(c);t.ResvFrameBegin(e,u),c=u.bits,get_framebits(e,i),o=i[l.VBR_max_bitrate]}for(var b=0;b<l.mode_gr;b++){a.on_pe(e,s,_[b],c,b,0),l.mode_ext==P.MPG_MD_MS_LR&&ms_convert(l.l3_side,b);for(var p=0;p<l.channels_out;++p){var m=l.l3_side.tt[b][p];l.masking_lower=Math.pow(10,.1*l.PSY.mask_adjust),init_outer_loop(l,m),0!=a.calc_xmin(e,n[b][p],m,r[b][p])&&(f=0),h+=_[b][p]}}for(b=0;b<l.mode_gr;b++)for(p=0;p<l.channels_out;p++)h>o&&(_[b][p]*=o,_[b][p]/=h);return f},this.calc_target_bits=function(s,n,r,i,_,o){var l,f,c,h,u=s.internal_flags,b=u.l3_side,p=0;u.bitrate_index=u.VBR_max_bitrate;var m=new A(p);for(o[0]=t.ResvFrameBegin(s,m),p=m.bits,u.bitrate_index=1,p=e.getframebits(s)-8*u.sideinfo_len,_[0]=p/(u.mode_gr*u.channels_out),p=s.VBR_mean_bitrate_kbps*s.framesize*1e3,0!=(1&u.substep_shaping)&&(p*=1.09),p/=s.out_samplerate,p-=8*u.sideinfo_len,p/=u.mode_gr*u.channels_out,(l=.93+.07*(11-s.compression_ratio)/5.5)<.9&&(l=.9),l>1&&(l=1),f=0;f<u.mode_gr;f++){var d=0;for(c=0;c<u.channels_out;c++){if(i[f][c]=int(l*p),n[f][c]>700){var v=int((n[f][c]-700)/1.4),g=b.tt[f][c];i[f][c]=int(l*p),g.block_type==P.SHORT_TYPE&&v<p/2&&(v=p/2),v>3*p/2?v=3*p/2:v<0&&(v=0),i[f][c]+=v}i[f][c]>H.MAX_BITS_PER_CHANNEL&&(i[f][c]=H.MAX_BITS_PER_CHANNEL),d+=i[f][c]}if(d>H.MAX_BITS_PER_GRANULE)for(c=0;c<u.channels_out;++c)i[f][c]*=H.MAX_BITS_PER_GRANULE,i[f][c]/=d}if(u.mode_ext==P.MPG_MD_MS_LR)for(f=0;f<u.mode_gr;f++)a.reduce_side(i[f],r[f],p*u.channels_out,H.MAX_BITS_PER_GRANULE);for(h=0,f=0;f<u.mode_gr;f++)for(c=0;c<u.channels_out;c++)i[f][c]>H.MAX_BITS_PER_CHANNEL&&(i[f][c]=H.MAX_BITS_PER_CHANNEL),h+=i[f][c];if(h>o[0])for(f=0;f<u.mode_gr;f++)for(c=0;c<u.channels_out;c++)i[f][c]*=o[0],i[f][c]/=h}}function x(){this.thm=new I,this.en=new I}function P(){var e=P.FFTOFFSET,t=P.MPG_MD_MS_LR,a=null;this.psy=null;var r=null,_=null,o=null;this.setModules=function(e,t,s,n){a=e,this.psy=t,r=t,_=n,o=s};var u=new function(){var e=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*h.SQRT2*.5/2384e-9,.017876148*h.SQRT2*.5/2384e-9,.003134727*h.SQRT2*.5/2384e-9,.002457142*h.SQRT2*.5/2384e-9,971317e-9*h.SQRT2*.5/2384e-9,218868e-9*h.SQRT2*.5/2384e-9,101566e-9*h.SQRT2*.5/2384e-9,13828e-9*h.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,49591e-9/2384e-9,1995.1556208053692,21458e-9/2384e-9,-69618e-9/2384e-9],t=[[2.382191739347913e-13,6.423305872147834e-13,9.400849094049688e-13,1.122435026096556e-12,1.183840321267481e-12,1.122435026096556e-12,9.40084909404969e-13,6.423305872147839e-13,2.382191739347918e-13,5.456116108943412e-12,4.878985199565852e-12,4.240448995017367e-12,3.559909094758252e-12,2.858043359288075e-12,2.156177623817898e-12,1.475637723558783e-12,8.371015190102974e-13,2.599706096327376e-13,-5.456116108943412e-12,-4.878985199565852e-12,-4.240448995017367e-12,-3.559909094758252e-12,-2.858043359288076e-12,-2.156177623817898e-12,-1.475637723558783e-12,-8.371015190102975e-13,-2.599706096327376e-13,-2.382191739347923e-13,-6.423305872147843e-13,-9.400849094049696e-13,-1.122435026096556e-12,-1.183840321267481e-12,-1.122435026096556e-12,-9.400849094049694e-13,-6.42330587214784e-13,-2.382191739347918e-13],[2.382191739347913e-13,6.423305872147834e-13,9.400849094049688e-13,1.122435026096556e-12,1.183840321267481e-12,1.122435026096556e-12,9.400849094049688e-13,6.423305872147841e-13,2.382191739347918e-13,5.456116108943413e-12,4.878985199565852e-12,4.240448995017367e-12,3.559909094758253e-12,2.858043359288075e-12,2.156177623817898e-12,1.475637723558782e-12,8.371015190102975e-13,2.599706096327376e-13,-5.461314069809755e-12,-4.921085770524055e-12,-4.343405037091838e-12,-3.732668368707687e-12,-3.093523840190885e-12,-2.430835727329465e-12,-1.734679010007751e-12,-9.74825365660928e-13,-2.797435120168326e-13,0,0,0,0,0,0,-2.283748241799531e-13,-4.037858874020686e-13,-2.146547464825323e-13],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2.283748241799531e-13,4.037858874020686e-13,2.146547464825323e-13,5.461314069809755e-12,4.921085770524055e-12,4.343405037091838e-12,3.732668368707687e-12,3.093523840190885e-12,2.430835727329466e-12,1.734679010007751e-12,9.74825365660928e-13,2.797435120168326e-13,-5.456116108943413e-12,-4.878985199565852e-12,-4.240448995017367e-12,-3.559909094758253e-12,-2.858043359288075e-12,-2.156177623817898e-12,-1.475637723558782e-12,-8.371015190102975e-13,-2.599706096327376e-13,-2.382191739347913e-13,-6.423305872147834e-13,-9.400849094049688e-13,-1.122435026096556e-12,-1.183840321267481e-12,-1.122435026096556e-12,-9.400849094049688e-13,-6.423305872147841e-13,-2.382191739347918e-13]],a=t[P.SHORT_TYPE],s=t[P.SHORT_TYPE],r=t[P.SHORT_TYPE],i=t[P.SHORT_TYPE],_=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function o(t,a,s){for(var n,r,i,_=10,o=a+238-14-286,l=-15;l<0;l++){var f,c,u;f=e[_+-10],c=t[o+-224]*f,u=t[a+224]*f,f=e[_+-9],c+=t[o+-160]*f,u+=t[a+160]*f,f=e[_+-8],c+=t[o+-96]*f,u+=t[a+96]*f,f=e[_+-7],c+=t[o+-32]*f,u+=t[a+32]*f,f=e[_+-6],c+=t[o+32]*f,u+=t[a+-32]*f,f=e[_+-5],c+=t[o+96]*f,u+=t[a+-96]*f,f=e[_+-4],c+=t[o+160]*f,u+=t[a+-160]*f,f=e[_+-3],c+=t[o+224]*f,u+=t[a+-224]*f,f=e[_+-2],c+=t[a+-256]*f,u-=t[o+256]*f,f=e[_+-1],c+=t[a+-192]*f,u-=t[o+192]*f,f=e[_+0],c+=t[a+-128]*f,u-=t[o+128]*f,f=e[_+1],c+=t[a+-64]*f,u-=t[o+64]*f,f=e[_+2],c+=t[a+0]*f,u-=t[o+0]*f,f=e[_+3],c+=t[a+64]*f,u-=t[o+-64]*f,f=e[_+4],c+=t[a+128]*f,u-=t[o+-128]*f,f=e[_+5],c+=t[a+192]*f,f=(u-=t[o+-192]*f)-(c*=e[_+6]),s[30+2*l]=u+c,s[31+2*l]=e[_+7]*f,_+=18,a--,o++}u=t[a+-16]*e[_+-10],c=t[a+-32]*e[_+-2],u+=(t[a+-48]-t[a+16])*e[_+-9],c+=t[a+-96]*e[_+-1],u+=(t[a+-80]+t[a+48])*e[_+-8],c+=t[a+-160]*e[_+0],u+=(t[a+-112]-t[a+80])*e[_+-7],c+=t[a+-224]*e[_+1],u+=(t[a+-144]+t[a+112])*e[_+-6],c-=t[a+32]*e[_+2],u+=(t[a+-176]-t[a+144])*e[_+-5],c-=t[a+96]*e[_+3],u+=(t[a+-208]+t[a+176])*e[_+-4],c-=t[a+160]*e[_+4],u+=(t[a+-240]-t[a+208])*e[_+-3],n=(c-=t[a+224])-u,r=c+u,u=s[14],c=s[15]-u,s[31]=r+u,s[30]=n+c,s[15]=n-c,s[14]=r-u,i=s[28]-s[0],s[0]+=s[28],s[28]=i*e[_+-36+7],i=s[29]-s[1],s[1]+=s[29],s[29]=i*e[_+-36+7],i=s[26]-s[2],s[2]+=s[26],s[26]=i*e[_+-72+7],i=s[27]-s[3],s[3]+=s[27],s[27]=i*e[_+-72+7],i=s[24]-s[4],s[4]+=s[24],s[24]=i*e[_+-108+7],i=s[25]-s[5],s[5]+=s[25],s[25]=i*e[_+-108+7],i=s[22]-s[6],s[6]+=s[22],s[22]=i*h.SQRT2,i=s[23]-s[7],s[7]+=s[23],s[23]=i*h.SQRT2-s[7],s[7]-=s[6],s[22]-=s[7],s[23]-=s[22],i=s[6],s[6]=s[31]-i,s[31]=s[31]+i,i=s[7],s[7]=s[30]-i,s[30]=s[30]+i,i=s[22],s[22]=s[15]-i,s[15]=s[15]+i,i=s[23],s[23]=s[14]-i,s[14]=s[14]+i,i=s[20]-s[8],s[8]+=s[20],s[20]=i*e[_+-180+7],i=s[21]-s[9],s[9]+=s[21],s[21]=i*e[_+-180+7],i=s[18]-s[10],s[10]+=s[18],s[18]=i*e[_+-216+7],i=s[19]-s[11],s[11]+=s[19],s[19]=i*e[_+-216+7],i=s[16]-s[12],s[12]+=s[16],s[16]=i*e[_+-252+7],i=s[17]-s[13],s[13]+=s[17],s[17]=i*e[_+-252+7],i=-s[20]+s[24],s[20]+=s[24],s[24]=i*e[_+-216+7],i=-s[21]+s[25],s[21]+=s[25],s[25]=i*e[_+-216+7],i=s[4]-s[8],s[4]+=s[8],s[8]=i*e[_+-216+7],i=s[5]-s[9],s[5]+=s[9],s[9]=i*e[_+-216+7],i=s[0]-s[12],s[0]+=s[12],s[12]=i*e[_+-72+7],i=s[1]-s[13],s[1]+=s[13],s[13]=i*e[_+-72+7],i=s[16]-s[28],s[16]+=s[28],s[28]=i*e[_+-72+7],i=-s[17]+s[29],s[17]+=s[29],s[29]=i*e[_+-72+7],i=h.SQRT2*(s[2]-s[10]),s[2]+=s[10],s[10]=i,i=h.SQRT2*(s[3]-s[11]),s[3]+=s[11],s[11]=i,i=h.SQRT2*(-s[18]+s[26]),s[18]+=s[26],s[26]=i-s[18],i=h.SQRT2*(-s[19]+s[27]),s[19]+=s[27],s[27]=i-s[19],i=s[2],s[19]-=s[3],s[3]-=i,s[2]=s[31]-i,s[31]+=i,i=s[3],s[11]-=s[19],s[18]-=i,s[3]=s[30]-i,s[30]+=i,i=s[18],s[27]-=s[11],s[19]-=i,s[18]=s[15]-i,s[15]+=i,i=s[19],s[10]-=i,s[19]=s[14]-i,s[14]+=i,i=s[10],s[11]-=i,s[10]=s[23]-i,s[23]+=i,i=s[11],s[26]-=i,s[11]=s[22]-i,s[22]+=i,i=s[26],s[27]-=i,s[26]=s[7]-i,s[7]+=i,i=s[27],s[27]=s[6]-i,s[6]+=i,i=h.SQRT2*(s[0]-s[4]),s[0]+=s[4],s[4]=i,i=h.SQRT2*(s[1]-s[5]),s[1]+=s[5],s[5]=i,i=h.SQRT2*(s[16]-s[20]),s[16]+=s[20],s[20]=i,i=h.SQRT2*(s[17]-s[21]),s[17]+=s[21],s[21]=i,i=-h.SQRT2*(s[8]-s[12]),s[8]+=s[12],s[12]=i-s[8],i=-h.SQRT2*(s[9]-s[13]),s[9]+=s[13],s[13]=i-s[9],i=-h.SQRT2*(s[25]-s[29]),s[25]+=s[29],s[29]=i-s[25],i=-h.SQRT2*(s[24]+s[28]),s[24]-=s[28],s[28]=i-s[24],i=s[24]-s[16],s[24]=i,i=s[20]-i,s[20]=i,i=s[28]-i,s[28]=i,i=s[25]-s[17],s[25]=i,i=s[21]-i,s[21]=i,i=s[29]-i,s[29]=i,i=s[17]-s[1],s[17]=i,i=s[9]-i,s[9]=i,i=s[25]-i,s[25]=i,i=s[5]-i,s[5]=i,i=s[21]-i,s[21]=i,i=s[13]-i,s[13]=i,i=s[29]-i,s[29]=i,i=s[1]-s[0],s[1]=i,i=s[16]-i,s[16]=i,i=s[17]-i,s[17]=i,i=s[8]-i,s[8]=i,i=s[9]-i,s[9]=i,i=s[24]-i,s[24]=i,i=s[25]-i,s[25]=i,i=s[4]-i,s[4]=i,i=s[5]-i,s[5]=i,i=s[20]-i,s[20]=i,i=s[21]-i,s[21]=i,i=s[12]-i,s[12]=i,i=s[13]-i,s[13]=i,i=s[28]-i,s[28]=i,i=s[29]-i,s[29]=i,i=s[0],s[0]+=s[31],s[31]-=i,i=s[1],s[1]+=s[30],s[30]-=i,i=s[16],s[16]+=s[15],s[15]-=i,i=s[17],s[17]+=s[14],s[14]-=i,i=s[8],s[8]+=s[23],s[23]-=i,i=s[9],s[9]+=s[22],s[22]-=i,i=s[24],s[24]+=s[7],s[7]-=i,i=s[25],s[25]+=s[6],s[6]-=i,i=s[4],s[4]+=s[27],s[27]-=i,i=s[5],s[5]+=s[26],s[26]-=i,i=s[20],s[20]+=s[11],s[11]-=i,i=s[21],s[21]+=s[10],s[10]-=i,i=s[12],s[12]+=s[19],s[19]-=i,i=s[13],s[13]+=s[18],s[18]-=i,i=s[28],s[28]+=s[3],s[3]-=i,i=s[29],s[29]+=s[2],s[2]-=i}function l(e,a){for(var s=0;s<3;s++){var n,r,i,_,o,l;r=(_=e[a+6]*t[P.SHORT_TYPE][0]-e[a+15])+(n=e[a+0]*t[P.SHORT_TYPE][2]-e[a+9]),i=_-n,o=(_=e[a+15]*t[P.SHORT_TYPE][0]+e[a+6])+(n=e[a+9]*t[P.SHORT_TYPE][2]+e[a+0]),l=-_+n,n=2.069978111953089e-11*(e[a+3]*t[P.SHORT_TYPE][1]-e[a+12]),_=2.069978111953089e-11*(e[a+12]*t[P.SHORT_TYPE][1]+e[a+3]),e[a+0]=1.90752519173728e-11*r+n,e[a+15]=1.90752519173728e-11*-o+_,i=.8660254037844387*i*1.907525191737281e-11,o=.5*o*1.907525191737281e-11+_,e[a+3]=i-o,e[a+6]=i+o,r=.5*r*1.907525191737281e-11-n,l=.8660254037844387*l*1.907525191737281e-11,e[a+9]=r+l,e[a+12]=r-l,a++}}this.mdct_sub48=function(e,h,u){for(var b,p,m,d,v,g,S,R,M,A,B,w,T,E,y,k,x,I,H,O,V,L=h,N=286,D=0;D<e.channels_out;D++){for(var X=0;X<e.mode_gr;X++){for(var q,Y=e.l3_side.tt[X][D],C=Y.xr,j=0,F=e.sb_sample[D][1-X],G=0,z=0;z<9;z++)for(o(L,N,F[G]),o(L,N+32,F[G+1]),G+=2,N+=64,q=1;q<32;q+=2)F[G-1][q]*=-1;for(q=0;q<32;q++,j+=18){var K=Y.block_type,Z=e.sb_sample[D][X],Q=e.sb_sample[D][1-X];if(0!=Y.mixed_block_flag&&q<2&&(K=0),e.amp_filter[q]<1e-12)f.fill(C,j+0,j+18,0);else{if(e.amp_filter[q]<1)for(z=0;z<18;z++)Q[z][_[q]]*=e.amp_filter[q];if(K==P.SHORT_TYPE){for(z=-3;z<0;z++){var U=t[P.SHORT_TYPE][z+3];C[j+3*z+9]=Z[9+z][_[q]]*U-Z[8-z][_[q]],C[j+3*z+18]=Z[14-z][_[q]]*U+Z[15+z][_[q]],C[j+3*z+10]=Z[15+z][_[q]]*U-Z[14-z][_[q]],C[j+3*z+19]=Q[2-z][_[q]]*U+Q[3+z][_[q]],C[j+3*z+11]=Q[3+z][_[q]]*U-Q[2-z][_[q]],C[j+3*z+20]=Q[8-z][_[q]]*U+Q[9+z][_[q]]}l(C,j)}else{var W=n(18);for(z=-9;z<0;z++){var J,$;J=t[K][z+27]*Q[z+9][_[q]]+t[K][z+36]*Q[8-z][_[q]],$=t[K][z+9]*Z[z+9][_[q]]-t[K][z+18]*Z[8-z][_[q]],W[z+9]=J-$*a[3+z+9],W[z+18]=J*a[3+z+9]+$}b=C,p=j,d=void 0,v=void 0,g=void 0,S=void 0,R=void 0,M=void 0,A=void 0,B=void 0,w=void 0,T=void 0,E=void 0,y=void 0,k=void 0,x=void 0,I=void 0,H=void 0,O=void 0,V=void 0,g=(m=W)[17]-m[9],R=m[15]-m[11],M=m[14]-m[12],A=m[0]+m[8],B=m[1]+m[7],w=m[2]+m[6],T=m[3]+m[5],b[p+17]=A+w-T-(B-m[4]),v=(A+w-T)*s[19]+(B-m[4]),d=(g-R-M)*s[18],b[p+5]=d+v,b[p+6]=d-v,S=(m[16]-m[10])*s[18],B=B*s[19]+m[4],d=g*s[12]+S+R*s[13]+M*s[14],v=-A*s[16]+B-w*s[17]+T*s[15],b[p+1]=d+v,b[p+2]=d-v,d=g*s[13]-S-R*s[14]+M*s[12],v=-A*s[17]+B-w*s[15]+T*s[16],b[p+9]=d+v,b[p+10]=d-v,d=g*s[14]-S+R*s[12]-M*s[13],v=A*s[15]-B+w*s[16]-T*s[17],b[p+13]=d+v,b[p+14]=d-v,E=m[8]-m[0],k=m[6]-m[2],x=m[5]-m[3],I=m[17]+m[9],H=m[16]+m[10],O=m[15]+m[11],V=m[14]+m[12],b[p+0]=I+O+V+(H+m[13]),d=(I+O+V)*s[19]-(H+m[13]),v=(E-k+x)*s[18],b[p+11]=d+v,b[p+12]=d-v,y=(m[7]-m[1])*s[18],H=m[13]-H*s[19],d=I*s[15]-H+O*s[16]+V*s[17],v=E*s[14]+y+k*s[12]+x*s[13],b[p+3]=d+v,b[p+4]=d-v,d=-I*s[17]+H-O*s[15]-V*s[16],v=E*s[13]+y-k*s[14]-x*s[12],b[p+7]=d+v,b[p+8]=d-v,d=-I*s[16]+H-O*s[17]-V*s[15],v=E*s[12]-y+k*s[13]-x*s[14],b[p+15]=d+v,b[p+16]=d-v}}if(K!=P.SHORT_TYPE&&0!=q)for(z=7;z>=0;--z){var ee,te;ee=C[j+z]*r[20+z]+C[j+-1-z]*i[28+z],te=C[j+z]*i[28+z]-C[j+-1-z]*r[20+z],C[j+-1-z]=ee,C[j+z]=te}}}if(L=u,N=286,1==e.mode_gr)for(var ae=0;ae<18;ae++)c.arraycopy(e.sb_sample[D][1][ae],0,e.sb_sample[D][0][ae],0,32)}}};this.lame_encode_mp3_frame=function(f,h,b,d,v,g){var S,R=l([2,2]);R[0][0]=new x,R[0][1]=new x,R[1][0]=new x,R[1][1]=new x;var M,A=l([2,2]);A[0][0]=new x,A[0][1]=new x,A[1][0]=new x,A[1][1]=new x;var B,w,T,E=[null,null],y=f.internal_flags,k=i([2,4]),I=[.5,.5],H=[[0,0],[0,0]],O=[[0,0],[0,0]];if(E[0]=h,E[1]=b,0==y.lame_encode_frame_init&&function(e,t){var a,s,r=e.internal_flags;if(0==r.lame_encode_frame_init){var i,_,o=n(2014),l=n(2014);for(r.lame_encode_frame_init=1,i=0,_=0;i<286+576*(1+r.mode_gr);++i)i<576*r.mode_gr?(o[i]=0,2==r.channels_out&&(l[i]=0)):(o[i]=t[0][_],2==r.channels_out&&(l[i]=t[1][_]),++_);for(s=0;s<r.mode_gr;s++)for(a=0;a<r.channels_out;a++)r.l3_side.tt[s][a].block_type=P.SHORT_TYPE;u.mdct_sub48(r,o,l)}}(f,E),y.padding=0,(y.slot_lag-=y.frac_SpF)<0&&(y.slot_lag+=f.out_samplerate,y.padding=1),0!=y.psymodel){var V=[null,null],L=0,N=s(2);for(T=0;T<y.mode_gr;T++){for(w=0;w<y.channels_out;w++)V[w]=E[w],L=576+576*T-P.FFTOFFSET;if(0!=(f.VBR==p.vbr_mtrh||f.VBR==p.vbr_mt?r.L3psycho_anal_vbr(f,V,L,T,R,A,H[T],O[T],k[T],N):r.L3psycho_anal_ns(f,V,L,T,R,A,H[T],O[T],k[T],N)))return-4;for(f.mode==m.JOINT_STEREO&&(I[T]=k[T][2]+k[T][3],I[T]>0&&(I[T]=k[T][3]/I[T])),w=0;w<y.channels_out;w++){var D=y.l3_side.tt[T][w];D.block_type=N[w],D.mixed_block_flag=0}}}else for(T=0;T<y.mode_gr;T++)for(w=0;w<y.channels_out;w++)y.l3_side.tt[T][w].block_type=P.NORM_TYPE,y.l3_side.tt[T][w].mixed_block_flag=0,O[T][w]=H[T][w]=700;if(function(e){var t,a;if(0!=e.ATH.useAdjust)if(a=e.loudness_sq[0][0],t=e.loudness_sq[1][0],2==e.channels_out?(a+=e.loudness_sq[0][1],t+=e.loudness_sq[1][1]):(a+=a,t+=t),2==e.mode_gr&&(a=Math.max(a,t)),a*=.5,(a*=e.ATH.aaSensitivityP)>.03125)e.ATH.adjust>=1?e.ATH.adjust=1:e.ATH.adjust<e.ATH.adjustLimit&&(e.ATH.adjust=e.ATH.adjustLimit),e.ATH.adjustLimit=1;else{var s=31.98*a+625e-6;e.ATH.adjust>=s?(e.ATH.adjust*=.075*s+.925,e.ATH.adjust<s&&(e.ATH.adjust=s)):e.ATH.adjustLimit>=s?e.ATH.adjust=s:e.ATH.adjust<e.ATH.adjustLimit&&(e.ATH.adjust=e.ATH.adjustLimit),e.ATH.adjustLimit=s}else e.ATH.adjust=1}(y),u.mdct_sub48(y,E[0],E[1]),y.mode_ext=P.MPG_MD_LR_LR,f.force_ms)y.mode_ext=P.MPG_MD_MS_LR;else if(f.mode==m.JOINT_STEREO){var X=0,q=0;for(T=0;T<y.mode_gr;T++)for(w=0;w<y.channels_out;w++)X+=O[T][w],q+=H[T][w];if(X<=1*q){var Y=y.l3_side.tt[0],C=y.l3_side.tt[y.mode_gr-1];Y[0].block_type==Y[1].block_type&&C[0].block_type==C[1].block_type&&(y.mode_ext=P.MPG_MD_MS_LR)}}if(y.mode_ext==t?(M=A,B=O):(M=R,B=H),f.analysis&&null!=y.pinfo)for(T=0;T<y.mode_gr;T++)for(w=0;w<y.channels_out;w++)y.pinfo.ms_ratio[T]=y.ms_ratio[T],y.pinfo.ms_ener_ratio[T]=I[T],y.pinfo.blocktype[T][w]=y.l3_side.tt[T][w].block_type,y.pinfo.pe[T][w]=B[T][w],c.arraycopy(y.l3_side.tt[T][w].xr,0,y.pinfo.xr[T][w],0,576),y.mode_ext==t&&(y.pinfo.ers[T][w]=y.pinfo.ers[T][w+2],c.arraycopy(y.pinfo.energy[T][w+2],0,y.pinfo.energy[T][w],0,y.pinfo.energy[T][w].length));if(f.VBR==p.vbr_off||f.VBR==p.vbr_abr){var j,F;for(j=0;j<18;j++)y.nsPsy.pefirbuf[j]=y.nsPsy.pefirbuf[j+1];for(F=0,T=0;T<y.mode_gr;T++)for(w=0;w<y.channels_out;w++)F+=B[T][w];for(y.nsPsy.pefirbuf[18]=F,F=y.nsPsy.pefirbuf[9],j=0;j<9;j++)F+=(y.nsPsy.pefirbuf[j]+y.nsPsy.pefirbuf[18-j])*P.fircoef[j];for(F=3350*y.mode_gr*y.channels_out/F,T=0;T<y.mode_gr;T++)for(w=0;w<y.channels_out;w++)B[T][w]*=F}if(y.iteration_loop.iteration_loop(f,B,I,M),a.format_bitstream(f),S=a.copy_buffer(y,d,v,g,1),f.bWriteVbrTag&&_.addVbrFrame(f),f.analysis&&null!=y.pinfo){for(w=0;w<y.channels_out;w++){var G;for(G=0;G<e;G++)y.pinfo.pcmdata[w][G]=y.pinfo.pcmdata[w][G+f.framesize];for(G=e;G<1600;G++)y.pinfo.pcmdata[w][G]=E[w][G-e]}o.set_frame_pinfo(f,M)}return function(e){var t,a;for(e.bitrate_stereoMode_Hist[e.bitrate_index][4]++,e.bitrate_stereoMode_Hist[15][4]++,2==e.channels_out&&(e.bitrate_stereoMode_Hist[e.bitrate_index][e.mode_ext]++,e.bitrate_stereoMode_Hist[15][e.mode_ext]++),t=0;t<e.mode_gr;++t)for(a=0;a<e.channels_out;++a){var s=0|e.l3_side.tt[t][a].block_type;0!=e.l3_side.tt[t][a].mixed_block_flag&&(s=4),e.bitrate_blockType_Hist[e.bitrate_index][s]++,e.bitrate_blockType_Hist[e.bitrate_index][5]++,e.bitrate_blockType_Hist[15][s]++,e.bitrate_blockType_Hist[15][5]++}}(y),S}}function I(){this.l=n(P.SBMAX_l),this.s=i([P.SBMAX_s,3]);var e=this;this.assign=function(t){c.arraycopy(t.l,0,e.l,0,P.SBMAX_l);for(var a=0;a<P.SBMAX_s;a++)for(var s=0;s<3;s++)e.s[a][s]=t.s[a][s]}}function H(){var t=40;function a(){this.write_timing=0,this.ptr=0,this.buf=e(t)}this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=i([2,H.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new function(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[s(4),s(4)];for(var e=0;e<2;e++)for(var t=0;t<2;t++)this.tt[e][t]=new E},this.ms_ratio=n(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=s(2),this.CurrentStep=s(2),this.masking_lower=0,this.bv_scf=s(576),this.pseudohalf=s(y.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*H.BPC+1),this.itime=r(2),this.sideinfo_len=0,this.sb_sample=i([2,2,18,P.SBLIMIT]),this.amp_filter=n(32),this.header=new Array(H.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new w,this.minval_l=n(P.CBANDS),this.minval_s=n(P.CBANDS),this.nb_1=i([4,P.CBANDS]),this.nb_2=i([4,P.CBANDS]),this.nb_s1=i([4,P.CBANDS]),this.nb_s2=i([4,P.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=n(4),this.loudness_sq=i([2,2]),this.loudness_sq_save=n(2),this.mld_l=n(P.SBMAX_l),this.mld_s=n(P.SBMAX_s),this.bm_l=s(P.SBMAX_l),this.bo_l=s(P.SBMAX_l),this.bm_s=s(P.SBMAX_s),this.bo_s=s(P.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=_([P.CBANDS,2]),this.s3ind_s=_([P.CBANDS,2]),this.numlines_s=s(P.CBANDS),this.numlines_l=s(P.CBANDS),this.rnumlines_l=n(P.CBANDS),this.mld_cb_l=n(P.CBANDS),this.mld_cb_s=n(P.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=n(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=s(2),this.nsPsy=new function(){this.last_en_subshort=i([4,9]),this.lastAttacks=s(4),this.pefirbuf=n(19),this.longfact=n(P.SBMAX_l),this.shortfact=n(P.SBMAX_s),this.attackthre=0,this.attackthre_s=0},this.VBR_seek_table=new function(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0},this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=_([16,5]),this.bitrate_blockType_Hist=_([16,6]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var o=0;o<this.en.length;o++)this.en[o]=new I;for(o=0;o<this.thm.length;o++)this.thm[o]=new I;for(o=0;o<this.header.length;o++)this.header[o]=new a}function O(){var e=new function(){var e=n(P.BLKSIZE),t=n(P.BLKSIZE_s/2),a=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function s(e,t,s){var n,r,i,_=0,o=t+(s<<=1);n=4;do{var l,f,c,u,b,p,m;m=n>>1,p=(b=n<<1)+(u=n),n=b<<1,i=(r=t)+m;do{A=e[r+0]-e[r+u],M=e[r+0]+e[r+u],E=e[r+b]-e[r+p],w=e[r+b]+e[r+p],e[r+b]=M-w,e[r+0]=M+w,e[r+p]=A-E,e[r+u]=A+E,A=e[i+0]-e[i+u],M=e[i+0]+e[i+u],E=h.SQRT2*e[i+p],w=h.SQRT2*e[i+b],e[i+b]=M-w,e[i+0]=M+w,e[i+p]=A-E,e[i+u]=A+E,i+=n,r+=n}while(r<o);for(f=a[_+0],l=a[_+1],c=1;c<m;c++){var d,v;d=1-2*l*l,v=2*l*f,r=t+c,i=t+u-c;do{var g,S,R,M,A,B,w,T,E,y;S=v*e[r+u]-d*e[i+u],g=d*e[r+u]+v*e[i+u],A=e[r+0]-g,M=e[r+0]+g,B=e[i+0]-S,R=e[i+0]+S,S=v*e[r+p]-d*e[i+p],g=d*e[r+p]+v*e[i+p],E=e[r+b]-g,w=e[r+b]+g,y=e[i+b]-S,T=e[i+b]+S,S=l*w-f*y,g=f*w+l*y,e[r+b]=M-g,e[r+0]=M+g,e[i+p]=B-S,e[i+u]=B+S,S=f*T-l*E,g=l*T+f*E,e[i+b]=R-g,e[i+0]=R+g,e[r+p]=A-S,e[r+u]=A+S,i+=n,r+=n}while(r<o);f=(d=f)*a[_+0]-l*a[_+1],l=d*a[_+1]+l*a[_+0]}_+=2}while(n<s)}var r=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function(e,a,n,i,_){for(var o=0;o<3;o++){var l=P.BLKSIZE_s/2,f=65535&192*(o+1),c=P.BLKSIZE_s/8-1;do{var h,u,b,p,m,d=255&r[c<<2];u=(h=t[d]*i[n][_+d+f])-(m=t[127-d]*i[n][_+d+f+128]),h+=m,p=(b=t[d+64]*i[n][_+d+f+64])-(m=t[63-d]*i[n][_+d+f+192]),b+=m,l-=4,a[o][l+0]=h+b,a[o][l+2]=h-b,a[o][l+1]=u+p,a[o][l+3]=u-p,u=(h=t[d+1]*i[n][_+d+f+1])-(m=t[126-d]*i[n][_+d+f+129]),h+=m,p=(b=t[d+65]*i[n][_+d+f+65])-(m=t[62-d]*i[n][_+d+f+193]),b+=m,a[o][l+P.BLKSIZE_s/2+0]=h+b,a[o][l+P.BLKSIZE_s/2+2]=h-b,a[o][l+P.BLKSIZE_s/2+1]=u+p,a[o][l+P.BLKSIZE_s/2+3]=u-p}while(--c>=0);s(a[o],l,P.BLKSIZE_s/2)}},this.fft_long=function(t,a,n,i,_){var o=P.BLKSIZE/8-1,l=P.BLKSIZE/2;do{var f,c,h,u,b,p=255&r[o];c=(f=e[p]*i[n][_+p])-(b=e[p+512]*i[n][_+p+512]),f+=b,u=(h=e[p+256]*i[n][_+p+256])-(b=e[p+768]*i[n][_+p+768]),h+=b,a[0+(l-=4)]=f+h,a[l+2]=f-h,a[l+1]=c+u,a[l+3]=c-u,c=(f=e[p+1]*i[n][_+p+1])-(b=e[p+513]*i[n][_+p+513]),f+=b,u=(h=e[p+257]*i[n][_+p+257])-(b=e[p+769]*i[n][_+p+769]),h+=b,a[l+P.BLKSIZE/2+0]=f+h,a[l+P.BLKSIZE/2+2]=f-h,a[l+P.BLKSIZE/2+1]=c+u,a[l+P.BLKSIZE/2+3]=c-u}while(--o>=0);s(a,l,P.BLKSIZE/2)},this.init_fft=function(a){for(var s=0;s<P.BLKSIZE;s++)e[s]=.42-.5*Math.cos(2*Math.PI*(s+.5)/P.BLKSIZE)+.08*Math.cos(4*Math.PI*(s+.5)/P.BLKSIZE);for(s=0;s<P.BLKSIZE_s/2;s++)t[s]=.5*(1-Math.cos(2*Math.PI*(s+.5)/P.BLKSIZE_s))}},t=2.302585092994046,a=2,r=16,_=2,o=16,l=.34,c=1/217621504/(P.BLKSIZE/2),d=.3,v=21,g=.2302585093;function S(e){return e}function R(e,t){for(var a=0,s=0;s<P.BLKSIZE/2;++s)a+=e[s]*t.ATH.eql_w[s];return a*=c}function M(t,a,s,n,r,i,_,o,l,f,c){var u=t.internal_flags;if(l<2)e.fft_long(u,n[r],l,f,c),e.fft_short(u,i[_],l,f,c);else if(2==l){for(var b=P.BLKSIZE-1;b>=0;--b){var p=n[r+0][b],m=n[r+1][b];n[r+0][b]=(p+m)*h.SQRT2*.5,n[r+1][b]=(p-m)*h.SQRT2*.5}for(var d=2;d>=0;--d)for(b=P.BLKSIZE_s-1;b>=0;--b){p=i[_+0][d][b],m=i[_+1][d][b];i[_+0][d][b]=(p+m)*h.SQRT2*.5,i[_+1][d][b]=(p-m)*h.SQRT2*.5}}a[0]=S(n[r+0][0]),a[0]*=a[0];for(b=P.BLKSIZE/2-1;b>=0;--b){var v=n[r+0][P.BLKSIZE/2-b],g=n[r+0][P.BLKSIZE/2+b];a[P.BLKSIZE/2-b]=S(.5*(v*v+g*g))}for(d=2;d>=0;--d){s[d][0]=i[_+0][d][0],s[d][0]*=s[d][0];for(b=P.BLKSIZE_s/2-1;b>=0;--b){v=i[_+0][d][P.BLKSIZE_s/2-b],g=i[_+0][d][P.BLKSIZE_s/2+b];s[d][P.BLKSIZE_s/2-b]=S(.5*(v*v+g*g))}}var M=0;for(b=11;b<P.HBLKSIZE;b++)M+=a[b];if(u.tot_ener[l]=M,t.analysis){for(b=0;b<P.HBLKSIZE;b++)u.pinfo.energy[o][l][b]=u.pinfo.energy_save[l][b],u.pinfo.energy_save[l][b]=a[b];u.pinfo.pe[o][l]=u.pe[l]}2==t.athaa_loudapprox&&l<2&&(u.loudness_sq[o][l]=u.loudness_sq_save[l],u.loudness_sq_save[l]=R(a,u))}var A,B,w,T=8,E=23,y=15,k=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];var x=[3.3246*3.3246,3.23837*3.23837,9.9500500969,9.0247369744,8.1854926609,7.0440875649,2.46209*2.46209,2.284*2.284,4.4892710641,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,2.4621061921,2.1508568964,1.37074*1.37074,1.31036*1.31036,1.5691069696,1.4555939904,1.16203*1.16203,1.2715945225,1.09428*1.09428,1.0659*1.0659,1.0779838276,1.0382591025,1],I=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1],H=[5.5396212496,2.29259*2.29259,4.9868695969,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,2.2499700001,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.2339655056,1.0779838276];function O(e,t,a,s,n,r){var i;if(t>e){if(!(t<e*B))return e+t;i=t/e}else{if(e>=t*B)return e+t;i=e/t}if(e+=t,s+3<=6){if(i>=A)return e;var _=0|h.FAST_LOG10_X(i,16);return e*I[_]}var o,l;_=0|h.FAST_LOG10_X(i,16);return t=0!=r?n.ATH.cb_s[a]*n.ATH.adjust:n.ATH.cb_l[a]*n.ATH.adjust,e<w*t?e>t?(o=1,_<=13&&(o=H[_]),l=h.FAST_LOG10_X(e/t,10/15),e*((x[_]-o)*l+o)):_>13?e:e*H[_]:e*x[_]}var V=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1];function L(e,t,a){var s;if(e<0&&(e=0),t<0&&(t=0),e<=0)return t;if(t<=0)return e;if(s=t>e?t/e:e/t,-2<=a&&a<=2){if(s>=A)return e+t;var n=0|h.FAST_LOG10_X(s,16);return(e+t)*V[n]}return s<B?e+t:(e<t&&(e=t),e)}function N(e,t,a,s,n){var r,i,_=0,o=0;for(r=i=0;r<P.SBMAX_s;++i,++r){for(var l=e.bo_s[r],f=e.npart_s,c=l<f?l:f;i<c;)_+=t[i],o+=a[i],i++;if(e.en[s].s[r][n]=_,e.thm[s].s[r][n]=o,i>=f){++r;break}var h=e.PSY.bo_s_weight[r],u=1-h;_=h*t[i],o=h*a[i],e.en[s].s[r][n]+=_,e.thm[s].s[r][n]+=o,_=u*t[i],o=u*a[i]}for(;r<P.SBMAX_s;++r)e.en[s].s[r][n]=0,e.thm[s].s[r][n]=0}function D(e,t,a,s){var n,r,i=0,_=0;for(n=r=0;n<P.SBMAX_l;++r,++n){for(var o=e.bo_l[n],l=e.npart_l,f=o<l?o:l;r<f;)i+=t[r],_+=a[r],r++;if(e.en[s].l[n]=i,e.thm[s].l[n]=_,r>=l){++n;break}var c=e.PSY.bo_l_weight[n],h=1-c;i=c*t[r],_=c*a[r],e.en[s].l[n]+=i,e.thm[s].l[n]+=_,i=h*t[r],_=h*a[r]}for(;n<P.SBMAX_l;++n)e.en[s].l[n]=0,e.thm[s].l[n]=0}function X(e,t,a,s,n,r){var i,l,f=e.internal_flags;for(l=i=0;l<f.npart_s;++l){for(var c=0,h=0,u=f.numlines_s[l],b=0;b<u;++b,++i){var p=t[r][i];c+=p,h<p&&(h=p)}a[l]=c}for(i=l=0;l<f.npart_s;l++){var m=f.s3ind_s[l][0],d=f.s3_ss[i++]*a[m];for(++m;m<=f.s3ind_s[l][1];)d+=f.s3_ss[i]*a[m],++i,++m;var v=_*f.nb_s1[n][l];if(s[l]=Math.min(d,v),f.blocktype_old[1&n]==P.SHORT_TYPE){v=o*f.nb_s2[n][l];var g=s[l];s[l]=Math.min(v,g)}f.nb_s2[n][l]=f.nb_s1[n][l],f.nb_s1[n][l]=d}for(;l<=P.CBANDS;++l)a[l]=0,s[l]=0}function q(e,t,a){return a>=1?e:a<=0?t:t>0?Math.pow(e/t,a)*t:0}var Y=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function C(e,a){for(var s=309.07,n=0;n<P.SBMAX_s-1;n++)for(var r=0;r<3;r++){var i=e.thm.s[n][r];if(i>0){var _=i*a,o=e.en.s[n][r];o>_&&(s+=o>1e10*_?Y[n]*(10*t):Y[n]*h.FAST_LOG10(o/_))}}return s}var j=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function F(e,a){for(var s=281.0575,n=0;n<P.SBMAX_l-1;n++){var r=e.thm.l[n];if(r>0){var i=r*a,_=e.en.l[n];_>i&&(s+=_>1e10*i?j[n]*(10*t):j[n]*h.FAST_LOG10(_/i))}}return s}function G(e,t,a,s,n){var r,i;for(r=i=0;r<e.npart_l;++r){var _,o=0,l=0;for(_=0;_<e.numlines_l[r];++_,++i){var f=t[i];o+=f,l<f&&(l=f)}a[r]=o,s[r]=l,n[r]=o*e.rnumlines_l[r]}}function z(e,t,a,s){var n=k.length-1,r=0,i=a[r]+a[r+1];i>0?((_=t[r])<t[r+1]&&(_=t[r+1]),(o=0|(i=20*(2*_-i)/(i*(e.numlines_l[r]+e.numlines_l[r+1]-1))))>n&&(o=n),s[r]=o):s[r]=0;for(r=1;r<e.npart_l-1;r++){var _,o;if((i=a[r-1]+a[r]+a[r+1])>0)(_=t[r-1])<t[r]&&(_=t[r]),_<t[r+1]&&(_=t[r+1]),(o=0|(i=20*(3*_-i)/(i*(e.numlines_l[r-1]+e.numlines_l[r]+e.numlines_l[r+1]-1))))>n&&(o=n),s[r]=o;else s[r]=0}(i=a[r-1]+a[r])>0?((_=t[r-1])<t[r]&&(_=t[r]),(o=0|(i=20*(2*_-i)/(i*(e.numlines_l[r-1]+e.numlines_l[r]-1))))>n&&(o=n),s[r]=o):s[r]=0}var K=[-1.730326e-17,-.01703172,-1.349528e-17,.0418072,-6.73278e-17,-.0876324,-3.0835e-17,.1863476,-1.104424e-16,-.627638];function Z(t,a,s,n,r,i,_,o){var l=t.internal_flags;if(n<2)e.fft_long(l,_[o],n,a,s);else if(2==n)for(var f=P.BLKSIZE-1;f>=0;--f){var c=_[o+0][f],u=_[o+1][f];_[o+0][f]=(c+u)*h.SQRT2*.5,_[o+1][f]=(c-u)*h.SQRT2*.5}i[0]=S(_[o+0][0]),i[0]*=i[0];for(f=P.BLKSIZE/2-1;f>=0;--f){var b=_[o+0][P.BLKSIZE/2-f],p=_[o+0][P.BLKSIZE/2+f];i[P.BLKSIZE/2-f]=S(.5*(b*b+p*p))}var m=0;for(f=11;f<P.HBLKSIZE;f++)m+=i[f];if(l.tot_ener[n]=m,t.analysis){for(f=0;f<P.HBLKSIZE;f++)l.pinfo.energy[r][n][f]=l.pinfo.energy_save[n][f],l.pinfo.energy_save[n][f]=i[f];l.pinfo.pe[r][n]=l.pe[n]}}function Q(t,a,s,n,r,i,_,o){var l=t.internal_flags;if(0==r&&n<2&&e.fft_short(l,_[o],n,a,s),2==n)for(var f=P.BLKSIZE_s-1;f>=0;--f){var c=_[o+0][r][f],u=_[o+1][r][f];_[o+0][r][f]=(c+u)*h.SQRT2*.5,_[o+1][r][f]=(c-u)*h.SQRT2*.5}i[r][0]=_[o+0][r][0],i[r][0]*=i[r][0];for(f=P.BLKSIZE_s/2-1;f>=0;--f){var b=_[o+0][r][P.BLKSIZE_s/2-f],p=_[o+0][r][P.BLKSIZE_s/2+f];i[r][P.BLKSIZE_s/2-f]=S(.5*(b*b+p*p))}}function U(e,t,a,s){var n=e.internal_flags;2==e.athaa_loudapprox&&a<2&&(n.loudness_sq[t][a]=n.loudness_sq_save[a],n.loudness_sq_save[a]=R(s,n))}this.L3psycho_anal_ns=function(e,t,_,o,l,c,h,b,g,S){var R,A,B,w,T,E,y,x,I,H,V=e.internal_flags,L=i([2,P.BLKSIZE]),Y=i([2,3,P.BLKSIZE_s]),j=n(P.CBANDS+1),Z=n(P.CBANDS+1),Q=n(P.CBANDS+2),U=s(2),W=s(2),J=i([2,576]),$=s(P.CBANDS+2),ee=s(P.CBANDS+2);for(f.fill(ee,0),R=V.channels_out,e.mode==m.JOINT_STEREO&&(R=4),I=e.VBR==p.vbr_off?0==V.ResvMax?0:V.ResvSize/V.ResvMax*.5:e.VBR==p.vbr_rh||e.VBR==p.vbr_mtrh||e.VBR==p.vbr_mt?.6:1,A=0;A<V.channels_out;A++){var te=t[A],ae=_+576-350-v+192;for(w=0;w<576;w++){var se,ne;for(se=te[ae+w+10],ne=0,T=0;T<(v-1)/2-1;T+=2)se+=K[T]*(te[ae+w+T]+te[ae+w+v-T]),ne+=K[T+1]*(te[ae+w+T+1]+te[ae+w+v-T-1]);J[A][w]=se+ne}l[o][A].en.assign(V.en[A]),l[o][A].thm.assign(V.thm[A]),R>2&&(c[o][A].en.assign(V.en[A+2]),c[o][A].thm.assign(V.thm[A+2]))}for(A=0;A<R;A++){var re,ie=n(12),_e=[0,0,0,0],oe=n(12),le=1,fe=n(P.CBANDS),ce=n(P.CBANDS),he=[0,0,0,0],ue=n(P.HBLKSIZE),be=i([3,P.HBLKSIZE_s]);for(w=0;w<3;w++)ie[w]=V.nsPsy.last_en_subshort[A][w+6],oe[w]=ie[w]/V.nsPsy.last_en_subshort[A][w+4],_e[0]+=ie[w];if(2==A)for(w=0;w<576;w++){var pe,me;pe=J[0][w],me=J[1][w],J[0][w]=pe+me,J[1][w]=pe-me}var de=J[1&A],ve=0;for(w=0;w<9;w++){for(var ge=ve+64,Se=1;ve<ge;ve++)Se<Math.abs(de[ve])&&(Se=Math.abs(de[ve]));V.nsPsy.last_en_subshort[A][w]=ie[w+3]=Se,_e[1+w/3]+=Se,Se>ie[w+3-2]?Se/=ie[w+3-2]:Se=ie[w+3-2]>10*Se?ie[w+3-2]/(10*Se):0,oe[w+3]=Se}if(e.analysis){var Re=oe[0];for(w=1;w<12;w++)Re<oe[w]&&(Re=oe[w]);V.pinfo.ers[o][A]=V.pinfo.ers_save[A],V.pinfo.ers_save[A]=Re}for(re=3==A?V.nsPsy.attackthre_s:V.nsPsy.attackthre,w=0;w<12;w++)0==he[w/3]&&oe[w]>re&&(he[w/3]=w%3+1);for(w=1;w<4;w++){(_e[w-1]>_e[w]?_e[w-1]/_e[w]:_e[w]/_e[w-1])<1.7&&(he[w]=0,1==w&&(he[0]=0))}for(0!=he[0]&&0!=V.nsPsy.lastAttacks[A]&&(he[0]=0),3!=V.nsPsy.lastAttacks[A]&&he[0]+he[1]+he[2]+he[3]==0||(le=0,0!=he[1]&&0!=he[0]&&(he[1]=0),0!=he[2]&&0!=he[1]&&(he[2]=0),0!=he[3]&&0!=he[2]&&(he[3]=0)),A<2?W[A]=le:0==le&&(W[0]=W[1]=0),g[A]=V.tot_ener[A],M(e,ue,be,L,1&A,Y,1&A,o,A,t,_),G(V,ue,j,fe,ce),z(V,fe,ce,$),x=0;x<3;x++){var Me,Ae;for(X(e,be,Z,Q,A,x),N(V,Z,Q,A,x),y=0;y<P.SBMAX_s;y++){if(Ae=V.thm[A].s[y][x],Ae*=.8,he[x]>=2||1==he[x+1]){var Be=0!=x?x-1:2;Se=q(V.thm[A].s[y][Be],Ae,.6*I);Ae=Math.min(Ae,Se)}if(1==he[x]){Be=0!=x?x-1:2,Se=q(V.thm[A].s[y][Be],Ae,d*I);Ae=Math.min(Ae,Se)}else if(0!=x&&3==he[x-1]||0==x&&3==V.nsPsy.lastAttacks[A]){Be=2!=x?x+1:0,Se=q(V.thm[A].s[y][Be],Ae,d*I);Ae=Math.min(Ae,Se)}Me=ie[3*x+3]+ie[3*x+4]+ie[3*x+5],6*ie[3*x+5]<Me&&(Ae*=.5,6*ie[3*x+4]<Me&&(Ae*=.5)),V.thm[A].s[y][x]=Ae}}for(V.nsPsy.lastAttacks[A]=he[2],E=0,B=0;B<V.npart_l;B++){for(var we=V.s3ind[B][0],Te=j[we]*k[$[we]],Ee=V.s3_ll[E++]*Te;++we<=V.s3ind[B][1];)Te=j[we]*k[$[we]],Ee=O(Ee,V.s3_ll[E++]*Te,we,we-B,V,0);Ee*=.158489319246111,V.blocktype_old[1&A]==P.SHORT_TYPE?Q[B]=Ee:Q[B]=q(Math.min(Ee,Math.min(a*V.nb_1[A][B],r*V.nb_2[A][B])),Ee,I),V.nb_2[A][B]=V.nb_1[A][B],V.nb_1[A][B]=Ee}for(;B<=P.CBANDS;++B)j[B]=0,Q[B]=0;D(V,j,Q,A)}(e.mode!=m.STEREO&&e.mode!=m.JOINT_STEREO||e.interChRatio>0&&function(e,t){var a=e.internal_flags;if(a.channels_out>1){for(var s=0;s<P.SBMAX_l;s++){var n=a.thm[0].l[s],r=a.thm[1].l[s];a.thm[0].l[s]+=r*t,a.thm[1].l[s]+=n*t}for(s=0;s<P.SBMAX_s;s++)for(var i=0;i<3;i++)n=a.thm[0].s[s][i],r=a.thm[1].s[s][i],a.thm[0].s[s][i]+=r*t,a.thm[1].s[s][i]+=n*t}}(e,e.interChRatio),e.mode==m.JOINT_STEREO)&&(!function(e){for(var t=0;t<P.SBMAX_l;t++)if(!(e.thm[0].l[t]>1.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;t<P.SBMAX_s;t++)for(var r=0;r<3;r++)e.thm[0].s[t][r]>1.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)}(V),H=e.msfix,Math.abs(H)>0&&function(e,t,a){var s=t,n=Math.pow(10,a);t*=2,s*=2;for(var r=0;r<P.SBMAX_l;r++)f=e.ATH.cb_l[e.bm_l[r]]*n,(_=Math.min(Math.max(e.thm[0].l[r],f),Math.max(e.thm[1].l[r],f)))*t<(o=Math.max(e.thm[2].l[r],f))+(l=Math.max(e.thm[3].l[r],f))&&(o*=c=_*s/(o+l),l*=c),e.thm[2].l[r]=Math.min(o,e.thm[2].l[r]),e.thm[3].l[r]=Math.min(l,e.thm[3].l[r]);for(n*=P.BLKSIZE_s/P.BLKSIZE,r=0;r<P.SBMAX_s;r++)for(var i=0;i<3;i++){var _,o,l,f,c;f=e.ATH.cb_s[e.bm_s[r]]*n,(_=Math.min(Math.max(e.thm[0].s[r][i],f),Math.max(e.thm[1].s[r][i],f)))*t<(o=Math.max(e.thm[2].s[r][i],f))+(l=Math.max(e.thm[3].s[r][i],f))&&(o*=c=_*t/(o+l),l*=c),e.thm[2].s[r][i]=Math.min(e.thm[2].s[r][i],o),e.thm[3].s[r][i]=Math.min(e.thm[3].s[r][i],l)}}(V,H,e.ATHlower*V.ATH.adjust));for(function(e,t,a,s){var n=e.internal_flags;e.short_blocks!=u.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var r=0;r<n.channels_out;r++)s[r]=P.NORM_TYPE,e.short_blocks==u.short_block_dispensed&&(t[r]=1),e.short_blocks==u.short_block_forced&&(t[r]=0),0!=t[r]?n.blocktype_old[r]==P.SHORT_TYPE&&(s[r]=P.STOP_TYPE):(s[r]=P.SHORT_TYPE,n.blocktype_old[r]==P.NORM_TYPE&&(n.blocktype_old[r]=P.START_TYPE),n.blocktype_old[r]==P.STOP_TYPE&&(n.blocktype_old[r]=P.SHORT_TYPE)),a[r]=n.blocktype_old[r],n.blocktype_old[r]=s[r]}(e,W,S,U),A=0;A<R;A++){var ye,ke,xe,Pe=0;A>1?(ye=b,Pe=-2,ke=P.NORM_TYPE,S[0]!=P.SHORT_TYPE&&S[1]!=P.SHORT_TYPE||(ke=P.SHORT_TYPE),xe=c[o][A-2]):(ye=h,Pe=0,ke=S[A],xe=l[o][A]),ke==P.SHORT_TYPE?ye[Pe+A]=C(xe,V.masking_lower):ye[Pe+A]=F(xe,V.masking_lower),e.analysis&&(V.pinfo.pe[o][A]=ye[Pe+A])}return 0};var W=[-1.730326e-17,-.01703172,-1.349528e-17,.0418072,-6.73278e-17,-.0876324,-3.0835e-17,.1863476,-1.104424e-16,-.627638];function J(e,t,a){if(0==a)for(var s=0;s<e.npart_s;s++)e.nb_s2[t][s]=e.nb_s1[t][s],e.nb_s1[t][s]=0}function $(e,t){for(var a=0;a<e.npart_l;a++)e.nb_2[t][a]=e.nb_1[t][a],e.nb_1[t][a]=0}function ee(e,t,a,s,r,i){var _,o,l,f=e.internal_flags,c=new float[P.CBANDS],h=n(P.CBANDS),u=new int[P.CBANDS];for(l=o=0;l<f.npart_s;++l){var b=0,p=0,m=f.numlines_s[l];for(_=0;_<m;++_,++o){var d=t[i][o];b+=d,p<d&&(p=d)}a[l]=b,c[l]=p,h[l]=b/m}for(;l<P.CBANDS;++l)c[l]=0,h[l]=0;for(function(e,t,a,s){var n=k.length-1,r=0,i=a[r]+a[r+1];for(i>0?((_=t[r])<t[r+1]&&(_=t[r+1]),(o=0|(i=20*(2*_-i)/(i*(e.numlines_s[r]+e.numlines_s[r+1]-1))))>n&&(o=n),s[r]=o):s[r]=0,r=1;r<e.npart_s-1;r++){var _,o;(i=a[r-1]+a[r]+a[r+1])>0?((_=t[r-1])<t[r]&&(_=t[r]),_<t[r+1]&&(_=t[r+1]),(o=0|(i=20*(3*_-i)/(i*(e.numlines_s[r-1]+e.numlines_s[r]+e.numlines_s[r+1]-1))))>n&&(o=n),s[r]=o):s[r]=0}(i=a[r-1]+a[r])>0?((_=t[r-1])<t[r]&&(_=t[r]),(o=0|(i=20*(2*_-i)/(i*(e.numlines_s[r-1]+e.numlines_s[r]-1))))>n&&(o=n),s[r]=o):s[r]=0}(f,c,h,u),o=l=0;l<f.npart_s;l++){var v,g,S,R,M,A=f.s3ind_s[l][0],B=f.s3ind_s[l][1];for(v=u[A],g=1,R=f.s3_ss[o]*a[A]*k[u[A]],++o,++A;A<=B;)v+=u[A],g+=1,R=L(R,S=f.s3_ss[o]*a[A]*k[u[A]],A-l),++o,++A;R*=M=.5*k[v=(1+2*v)/(2*g)],s[l]=R,f.nb_s2[r][l]=f.nb_s1[r][l],f.nb_s1[r][l]=R,S=c[l],S*=f.minval_s[l],S*=M,s[l]>S&&(s[l]=S),f.masking_lower>1&&(s[l]*=f.masking_lower),s[l]>a[l]&&(s[l]=a[l]),f.masking_lower<1&&(s[l]*=f.masking_lower)}for(;l<P.CBANDS;++l)a[l]=0,s[l]=0}function te(e,t,i,_,o){var l,f=n(P.CBANDS),c=n(P.CBANDS),h=s(P.CBANDS+2);G(e,t,i,f,c),z(e,f,c,h);var u=0;for(l=0;l<e.npart_l;l++){var b,p,m,v=e.s3ind[l][0],g=e.s3ind[l][1],S=0,R=0;for(S=h[v],R+=1,p=e.s3_ll[u]*i[v]*k[h[v]],++u,++v;v<=g;)S+=h[v],R+=1,p=L(p,b=e.s3_ll[u]*i[v]*k[h[v]],v-l),++u,++v;if(p*=m=.5*k[S=(1+2*S)/(2*R)],e.blocktype_old[1&o]==P.SHORT_TYPE){var M=a*e.nb_1[o][l];_[l]=M>0?Math.min(p,M):Math.min(p,i[l]*d)}else{var A=r*e.nb_2[o][l],B=a*e.nb_1[o][l];A<=0&&(A=p),B<=0&&(B=p),M=e.blocktype_old[1&o]==P.NORM_TYPE?Math.min(B,A):B,_[l]=Math.min(p,M)}e.nb_2[o][l]=e.nb_1[o][l],e.nb_1[o][l]=p,b=f[l],b*=e.minval_l[l],b*=m,_[l]>b&&(_[l]=b),e.masking_lower>1&&(_[l]*=e.masking_lower),_[l]>i[l]&&(_[l]=i[l]),e.masking_lower<1&&(_[l]*=e.masking_lower)}for(;l<P.CBANDS;++l)i[l]=0,_[l]=0}function ae(e,t,a,s,n,r,i){for(var _,o,l=2*r,f=r>0?Math.pow(10,n):1,c=0;c<i;++c){var h=e[2][c],u=e[3][c],b=t[0][c],p=t[1][c],m=t[2][c],d=t[3][c];if(b<=1.58*p&&p<=1.58*b){var v=a[c]*u,g=a[c]*h;o=Math.max(m,Math.min(d,v)),_=Math.max(d,Math.min(m,g))}else o=m,_=d;if(r>0){var S,R,M=s[c]*f;if(S=Math.min(Math.max(b,M),Math.max(p,M)),(R=(m=Math.max(o,M))+(d=Math.max(_,M)))>0&&S*l<R){var A=S*l/R;m*=A,d*=A}o=Math.min(m,o),_=Math.min(d,_)}o>h&&(o=h),_>u&&(_=u),t[2][c]=o,t[3][c]=_}}function se(e,t){var a;return(a=e>=0?27*-e:e*t)<=-72?0:Math.exp(a*g)}function ne(e){var t,a,s=0;for(s=0;se(s,e)>1e-20;s-=1);for(n=s,r=0;Math.abs(r-n)>1e-12;)se(s=(r+n)/2,e)>0?r=s:n=s;t=n;var n,r;s=0;for(s=0;se(s,e)>1e-20;s+=1);for(n=0,r=s;Math.abs(r-n)>1e-12;)se(s=(r+n)/2,e)>0?n=s:r=s;a=r;var i,_=0;for(i=0;i<=1e3;++i){_+=se(s=t+i*(a-t)/1e3,e)}return 1001/(_*(a-t))}function re(e){return e<0&&(e=0),e*=.001,13*Math.atan(.76*e)+3.5*Math.atan(e*e/56.25)}function ie(e,t,a,r,i,_,o,f,c,h,u,b){var p,m=n(P.CBANDS+1),d=f/(b>15?1152:384),v=s(P.HBLKSIZE);f/=c;var g=0,S=0;for(p=0;p<P.CBANDS;p++){var R;for(x=re(f*g),m[p]=f*g,R=g;re(f*R)-x<l&&R<=c/2;R++);for(e[p]=R-g,S=p+1;g<R;)v[g++]=p;if(g>c/2){g=c/2,++p;break}}m[p]=f*g;for(var M=0;M<b;M++){var A,B,w,T,E;w=h[M],T=h[M+1],(A=0|Math.floor(.5+u*(w-.5)))<0&&(A=0),(B=0|Math.floor(.5+u*(T-.5)))>c/2&&(B=c/2),a[M]=(v[A]+v[B])/2,t[M]=v[B];var y=d*T;o[M]=(y-m[t[M]])/(m[t[M]+1]-m[t[M]]),o[M]<0?o[M]=0:o[M]>1&&(o[M]=1),E=re(f*h[M]*u),E=Math.min(E,15.5)/15.5,_[M]=Math.pow(10,1.25*(1-Math.cos(Math.PI*E))-2.5)}g=0;for(var k=0;k<S;k++){var x,I,H=e[k];x=re(f*g),I=re(f*(g+H-1)),r[k]=.5*(x+I),x=re(f*(g-.5)),I=re(f*(g+H-.5)),i[k]=I-x,g+=H}return S}function _e(e,t,a,s,r,_){var o,l,f,c,h,u,b=i([P.CBANDS,P.CBANDS]),p=0;if(_)for(var m=0;m<t;m++)for(o=0;o<t;o++){var d=(l=a[m]-a[o],f=void 0,c=void 0,h=void 0,u=void 0,f=l,c=(f*=f>=0?3:1.5)>=.5&&f<=2.5?8*((u=f-.5)*u-2*u):0,((h=15.811389+7.5*(f+=.474)-17.5*Math.sqrt(1+f*f))<=-60?0:(f=Math.exp((c+h)*g),f/=.6609193))*s[o]);b[m][o]=d*r[m]}else for(o=0;o<t;o++){var v=15+Math.min(21/a[o],12),S=ne(v);for(m=0;m<t;m++){d=S*se(a[m]-a[o],v)*s[o];b[m][o]=d*r[m]}}for(m=0;m<t;m++){for(o=0;o<t&&!(b[m][o]>0);o++);for(e[m][0]=o,o=t-1;o>0&&!(b[m][o]>0);o--);e[m][1]=o,p+=e[m][1]-e[m][0]+1}var R=n(p),M=0;for(m=0;m<t;m++)for(o=e[m][0];o<=e[m][1];o++)R[M++]=b[m][o];return R}function oe(e){var t=re(e);return t=Math.min(t,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*t))-2.5)}function le(e,t){return e<-.3&&(e=3410),e/=1e3,e=Math.max(.1,e),3.64*Math.pow(e,-.8)-6.8*Math.exp(-.6*Math.pow(e-3.4,2))+6*Math.exp(-.15*Math.pow(e-8.7,2))+.001*(.6+.04*t)*Math.pow(e,4)}this.L3psycho_anal_vbr=function(e,t,a,r,_,o,l,f,c,h){var b=e.internal_flags,p=n(P.HBLKSIZE),g=i([3,P.HBLKSIZE_s]),S=i([2,P.BLKSIZE]),R=i([2,3,P.BLKSIZE_s]),M=i([4,P.CBANDS]),A=i([4,P.CBANDS]),B=i([4,3]),w=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],T=s(2),E=e.mode==m.JOINT_STEREO?4:b.channels_out;!function(e,t,a,s,r,_,o,l,f,c){for(var h=i([2,576]),u=e.internal_flags,b=u.channels_out,p=e.mode==m.JOINT_STEREO?4:b,d=0;d<b;d++){firbuf=t[d];for(var g=a+576-350-v+192,S=0;S<576;S++){var R,M;R=firbuf[g+S+10],M=0;for(var A=0;A<(v-1)/2-1;A+=2)R+=W[A]*(firbuf[g+S+A]+firbuf[g+S+v-A]),M+=W[A+1]*(firbuf[g+S+A+1]+firbuf[g+S+v-A-1]);h[d][S]=R+M}r[s][d].en.assign(u.en[d]),r[s][d].thm.assign(u.thm[d]),p>2&&(_[s][d].en.assign(u.en[d+2]),_[s][d].thm.assign(u.thm[d+2]))}for(d=0;d<p;d++){var B=n(12),w=n(12),T=[0,0,0,0],E=h[1&d],y=0,k=3==d?u.nsPsy.attackthre_s:u.nsPsy.attackthre,x=1;if(2==d)for(S=0,A=576;A>0;++S,--A){var P=h[0][S],I=h[1][S];h[0][S]=P+I,h[1][S]=P-I}for(S=0;S<3;S++)w[S]=u.nsPsy.last_en_subshort[d][S+6],B[S]=w[S]/u.nsPsy.last_en_subshort[d][S+4],T[0]+=w[S];for(S=0;S<9;S++){for(var H=y+64,O=1;y<H;y++)O<Math.abs(E[y])&&(O=Math.abs(E[y]));u.nsPsy.last_en_subshort[d][S]=w[S+3]=O,T[1+S/3]+=O,O>w[S+3-2]?O/=w[S+3-2]:O=w[S+3-2]>10*O?w[S+3-2]/(10*O):0,B[S+3]=O}for(S=0;S<3;++S){var V=w[3*S+3]+w[3*S+4]+w[3*S+5],L=1;6*w[3*S+5]<V&&(L*=.5,6*w[3*S+4]<V&&(L*=.5)),l[d][S]=L}if(e.analysis){var N=B[0];for(S=1;S<12;S++)N<B[S]&&(N=B[S]);u.pinfo.ers[s][d]=u.pinfo.ers_save[d],u.pinfo.ers_save[d]=N}for(S=0;S<12;S++)0==f[d][S/3]&&B[S]>k&&(f[d][S/3]=S%3+1);for(S=1;S<4;S++){var D=T[S-1],X=T[S];Math.max(D,X)<4e4&&D<1.7*X&&X<1.7*D&&(1==S&&f[d][0]<=f[d][S]&&(f[d][0]=0),f[d][S]=0)}f[d][0]<=u.nsPsy.lastAttacks[d]&&(f[d][0]=0),3!=u.nsPsy.lastAttacks[d]&&f[d][0]+f[d][1]+f[d][2]+f[d][3]==0||(x=0,0!=f[d][1]&&0!=f[d][0]&&(f[d][1]=0),0!=f[d][2]&&0!=f[d][1]&&(f[d][2]=0),0!=f[d][3]&&0!=f[d][2]&&(f[d][3]=0)),d<2?c[d]=x:0==x&&(c[0]=c[1]=0),o[d]=u.tot_ener[d]}}(e,t,a,r,_,o,c,B,w,T),function(e,t){var a=e.internal_flags;e.short_blocks!=u.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var s=0;s<a.channels_out;s++)e.short_blocks==u.short_block_dispensed&&(t[s]=1),e.short_blocks==u.short_block_forced&&(t[s]=0)}(e,T);for(var y=0;y<E;y++){Z(e,t,a,y,r,p,S,x=1&y),U(e,r,y,p),0!=T[x]?te(b,p,M[y],A[y],y):$(b,y)}T[0]+T[1]==2&&e.mode==m.JOINT_STEREO&&ae(M,A,b.mld_cb_l,b.ATH.cb_l,e.ATHlower*b.ATH.adjust,e.msfix,b.npart_l);for(y=0;y<E;y++){0!=T[x=1&y]&&D(b,M[y],A[y],y)}for(var k=0;k<3;k++){for(y=0;y<E;++y){0!=T[x=1&y]?J(b,y,k):(Q(e,t,a,y,k,g,R,x),ee(e,g,M[y],A[y],y,k))}T[0]+T[1]==0&&e.mode==m.JOINT_STEREO&&ae(M,A,b.mld_cb_s,b.ATH.cb_s,e.ATHlower*b.ATH.adjust,e.msfix,b.npart_s);for(y=0;y<E;++y){0==T[x=1&y]&&N(b,M[y],A[y],y,k)}}for(y=0;y<E;y++){var x;if(0==T[x=1&y])for(var I=0;I<P.SBMAX_s;I++){var H=n(3);for(k=0;k<3;k++){var O=b.thm[y].s[I][k];if(O*=.8,w[y][k]>=2||1==w[y][k+1]){var V=0!=k?k-1:2,L=q(b.thm[y].s[I][V],O,.36);O=Math.min(O,L)}else if(1==w[y][k]){V=0!=k?k-1:2,L=q(b.thm[y].s[I][V],O,.6*d);O=Math.min(O,L)}else if(0!=k&&3==w[y][k-1]||0==k&&3==b.nsPsy.lastAttacks[y]){V=2!=k?k+1:0,L=q(b.thm[y].s[I][V],O,.6*d);O=Math.min(O,L)}O*=B[y][k],H[k]=O}for(k=0;k<3;k++)b.thm[y].s[I][k]=H[k]}}for(y=0;y<E;y++)b.nsPsy.lastAttacks[y]=w[y][2];!function(e,t,a){for(var s=e.internal_flags,n=0;n<s.channels_out;n++){var r=P.NORM_TYPE;0!=t[n]?s.blocktype_old[n]==P.SHORT_TYPE&&(r=P.STOP_TYPE):(r=P.SHORT_TYPE,s.blocktype_old[n]==P.NORM_TYPE&&(s.blocktype_old[n]=P.START_TYPE),s.blocktype_old[n]==P.STOP_TYPE&&(s.blocktype_old[n]=P.SHORT_TYPE)),a[n]=s.blocktype_old[n],s.blocktype_old[n]=r}}(e,T,h);for(y=0;y<E;y++){var X,Y,j,G;y>1?(X=f,Y=-2,j=P.NORM_TYPE,h[0]!=P.SHORT_TYPE&&h[1]!=P.SHORT_TYPE||(j=P.SHORT_TYPE),G=o[r][y-2]):(X=l,Y=0,j=h[y],G=_[r][y]),j==P.SHORT_TYPE?X[Y+y]=C(G,b.masking_lower):X[Y+y]=F(G,b.masking_lower),e.analysis&&(b.pinfo.pe[r][y]=X[Y+y])}return 0},this.psymodel_init=function(a){var s,r=a.internal_flags,i=!0,_=13,o=0,l=0,f=-8.25,c=-4.5,h=n(P.CBANDS),u=n(P.CBANDS),m=n(P.CBANDS),d=a.out_samplerate;switch(a.experimentalZ){default:case 0:i=!0;break;case 1:i=a.VBR!=p.vbr_mtrh&&a.VBR!=p.vbr_mt;break;case 2:i=!1;break;case 3:_=8,o=-1.75,l=-.0125,f=-8.25,c=-2.25}for(r.ms_ener_ratio_old=.25,r.blocktype_old[0]=r.blocktype_old[1]=P.NORM_TYPE,s=0;s<4;++s){for(var v=0;v<P.CBANDS;++v)r.nb_1[s][v]=1e20,r.nb_2[s][v]=1e20,r.nb_s1[s][v]=r.nb_s2[s][v]=1;for(var g=0;g<P.SBMAX_l;g++)r.en[s].l[g]=1e20,r.thm[s].l[g]=1e20;for(v=0;v<3;++v){for(g=0;g<P.SBMAX_s;g++)r.en[s].s[g][v]=1e20,r.thm[s].s[g][v]=1e20;r.nsPsy.lastAttacks[s]=0}for(v=0;v<9;v++)r.nsPsy.last_en_subshort[s][v]=10}for(r.loudness_sq_save[0]=r.loudness_sq_save[1]=0,r.npart_l=ie(r.numlines_l,r.bo_l,r.bm_l,h,u,r.mld_l,r.PSY.bo_l_weight,d,P.BLKSIZE,r.scalefac_band.l,P.BLKSIZE/1152,P.SBMAX_l),s=0;s<r.npart_l;s++){var S=o;h[s]>=_&&(S=l*(h[s]-_)/(24-_)+o*(24-h[s])/(24-_)),m[s]=Math.pow(10,S/10),r.numlines_l[s]>0?r.rnumlines_l[s]=1/r.numlines_l[s]:r.rnumlines_l[s]=0}r.s3_ll=_e(r.s3ind,r.npart_l,h,u,m,i);var R;v=0;for(s=0;s<r.npart_l;s++){x=b.MAX_VALUE;for(var M=0;M<r.numlines_l[s];M++,v++){var k=d*v/(1e3*P.BLKSIZE);I=this.ATHformula(1e3*k,a)-20,I=Math.pow(10,.1*I),x>(I*=r.numlines_l[s])&&(x=I)}r.ATH.cb_l[s]=x,(x=20*h[s]/10-20)>6&&(x=100),x<-15&&(x=-15),x-=8,r.minval_l[s]=Math.pow(10,x/10)*r.numlines_l[s]}for(r.npart_s=ie(r.numlines_s,r.bo_s,r.bm_s,h,u,r.mld_s,r.PSY.bo_s_weight,d,P.BLKSIZE_s,r.scalefac_band.s,P.BLKSIZE_s/384,P.SBMAX_s),v=0,s=0;s<r.npart_s;s++){var x;S=f;h[s]>=_&&(S=c*(h[s]-_)/(24-_)+f*(24-h[s])/(24-_)),m[s]=Math.pow(10,S/10),x=b.MAX_VALUE;for(M=0;M<r.numlines_s[s];M++,v++){var I;k=d*v/(1e3*P.BLKSIZE_s);I=this.ATHformula(1e3*k,a)-20,I=Math.pow(10,.1*I),x>(I*=r.numlines_s[s])&&(x=I)}r.ATH.cb_s[s]=x,x=7*h[s]/12-7,h[s]>12&&(x*=1+3.1*Math.log(1+x)),h[s]<12&&(x*=1+2.3*Math.log(1-x)),x<-15&&(x=-15),x-=8,r.minval_s[s]=Math.pow(10,x/10)*r.numlines_s[s]}r.s3_ss=_e(r.s3ind_s,r.npart_s,h,u,m,i),A=Math.pow(10,(T+1)/16),B=Math.pow(10,(E+1)/16),w=Math.pow(10,y/10),e.init_fft(r),r.decay=Math.exp(-1*t/(.01*d/192)),R=3.5,0!=(2&a.exp_nspsytune)&&(R=1),Math.abs(a.msfix)>0&&(R=a.msfix),a.msfix=R;for(var H=0;H<r.npart_l;H++)r.s3ind[H][1]>r.npart_l-1&&(r.s3ind[H][1]=r.npart_l-1);var O=576*r.mode_gr/d;if(r.ATH.decay=Math.pow(10,-1.2*O),r.ATH.adjust=.01,r.ATH.adjustLimit=1,-1!=a.ATHtype){var V=a.out_samplerate/P.BLKSIZE,L=0;for(k=0,s=0;s<P.BLKSIZE/2;++s)k+=V,r.ATH.eql_w[s]=1/Math.pow(10,this.ATHformula(k,a)/10),L+=r.ATH.eql_w[s];for(L=1/L,s=P.BLKSIZE/2;--s>=0;)r.ATH.eql_w[s]*=L}for(H=v=0;H<r.npart_s;++H)for(s=0;s<r.numlines_s[H];++s)++v;for(H=v=0;H<r.npart_l;++H)for(s=0;s<r.numlines_l[H];++s)++v;for(v=0,s=0;s<r.npart_l;s++){k=d*(v+r.numlines_l[s]/2)/(1*P.BLKSIZE);r.mld_cb_l[s]=oe(k),v+=r.numlines_l[s]}for(;s<P.CBANDS;++s)r.mld_cb_l[s]=1;for(v=0,s=0;s<r.npart_s;s++){k=d*(v+r.numlines_s[s]/2)/(1*P.BLKSIZE_s);r.mld_cb_s[s]=oe(k),v+=r.numlines_s[s]}for(;s<P.CBANDS;++s)r.mld_cb_s[s]=1;return 0},this.ATHformula=function(e,t){var a;switch(t.ATHtype){case 0:a=le(e,9);break;case 1:a=le(e,-1);break;case 2:a=le(e,0);break;case 3:a=le(e,1)+6;break;case 4:a=le(e,t.ATHcurve);break;default:a=le(e,0)}return a}}function V(){var e=this;V.V9=410,V.V8=420,V.V7=430,V.V6=440,V.V5=450,V.V4=460,V.V3=470,V.V2=480,V.V1=490,V.V0=500,V.R3MIX=1e3,V.STANDARD=1001,V.EXTREME=1002,V.INSANE=1003,V.STANDARD_FAST=1004,V.EXTREME_FAST=1005,V.MEDIUM=1006,V.MEDIUM_FAST=1007;var t,a,r,i,l;V.LAME_MAXMP3BUFFER=147456;var f,h,b,v=new O;function S(){this.lowerlimit=0}function R(e,t){this.lowpass=t}this.enc=new P,this.setModules=function(e,s,n,_,o,c,u,p,m){t=e,a=s,r=n,i=_,l=o,f=c,u,h=p,b=m,this.enc.setModules(a,v,i,f)};var B=4294479419;function w(e){return e>1?0:e<=0?1:Math.cos(Math.PI/2*e)}function T(e,t){switch(e){case 44100:return t.version=1,0;case 48e3:return t.version=1,1;case 32e3:return t.version=1,2;case 22050:return t.version=0,0;case 24e3:return t.version=0,1;case 16e3:return t.version=0,2;case 11025:return t.version=0,0;case 12e3:return t.version=0,1;case 8e3:return t.version=0,2;default:return t.version=0,-1}}function E(e,t,a){a<16e3&&(t=2);for(var s=M.bitrate_table[t][1],n=2;n<=14;n++)M.bitrate_table[t][n]>0&&Math.abs(M.bitrate_table[t][n]-e)<Math.abs(s-e)&&(s=M.bitrate_table[t][n]);return s}function k(e,t,a){a<16e3&&(t=2);for(var s=0;s<=14;s++)if(M.bitrate_table[t][s]>0&&M.bitrate_table[t][s]==e)return s;return-1}function x(t,a){var s=[new R(8,2e3),new R(16,3700),new R(24,3900),new R(32,5500),new R(40,7e3),new R(48,7500),new R(56,1e4),new R(64,11e3),new R(80,13500),new R(96,15100),new R(112,15600),new R(128,17e3),new R(160,17500),new R(192,18600),new R(224,19400),new R(256,19700),new R(320,20500)],n=e.nearestBitrateFullIndex(a);t.lowerlimit=s[n].lowpass}function I(e){var t=P.BLKSIZE+e.framesize-P.FFTOFFSET;return t=Math.max(t,512+e.framesize-32)}function L(t,a,s,n,r,i){var _=e.enc.lame_encode_mp3_frame(t,a,s,n,r,i);return t.frameNum++,_}function N(){this.n_in=0,this.n_out=0}function D(){this.num_used=0}function X(e,t,a){var s=Math.PI*t;(e/=a)<0&&(e=0),e>1&&(e=1);var n=e-.5,r=.42-.5*Math.cos(2*e*Math.PI)+.08*Math.cos(4*e*Math.PI);return Math.abs(n)<1e-9?s/Math.PI:r*Math.sin(a*s*n)/(Math.PI*a*n)}function q(e,t,a,s,r,i,_,o,l){var f,c,h=e.internal_flags,u=0,b=e.out_samplerate/function e(t,a){return 0!=a?e(a,t%a):t}(e.out_samplerate,e.in_samplerate);b>H.BPC&&(b=H.BPC);var p=Math.abs(h.resample_ratio-Math.floor(.5+h.resample_ratio))<1e-4?1:0,m=1/h.resample_ratio;m>1&&(m=1);var d=31;0==d%2&&--d;var v=(d+=p)+1;if(0==h.fill_buffer_resample_init){for(h.inbuf_old[0]=n(v),h.inbuf_old[1]=n(v),f=0;f<=2*b;++f)h.blackfilt[f]=n(v);for(h.itime[0]=0,h.itime[1]=0,u=0;u<=2*b;u++){var g=0,S=(u-b)/(2*b);for(f=0;f<=d;f++)g+=h.blackfilt[u][f]=X(f-S,m,d);for(f=0;f<=d;f++)h.blackfilt[u][f]/=g}h.fill_buffer_resample_init=1}var R=h.inbuf_old[l];for(c=0;c<s;c++){var M,A;if(M=c*h.resample_ratio,d+(u=0|Math.floor(M-h.itime[l]))-d/2>=_)break;S=M-h.itime[l]-(u+d%2*.5);A=0|Math.floor(2*S*b+b+.5);var B=0;for(f=0;f<=d;++f){var w=0|f+u-d/2;B+=(w<0?R[v+w]:r[i+w])*h.blackfilt[A][f]}t[a+c]=B}if(o.num_used=Math.min(_,d+u-d/2),h.itime[l]+=o.num_used-c*h.resample_ratio,o.num_used>=v)for(f=0;f<v;f++)R[f]=r[i+o.num_used+f-v];else{var T=v-o.num_used;for(f=0;f<T;++f)R[f]=R[f+o.num_used];for(u=0;f<v;++f,++u)R[f]=r[i+u]}return c}function Y(e,t,a,s,n,r){var i=e.internal_flags;if(i.resample_ratio<.9999||i.resample_ratio>1.0001)for(var _=0;_<i.channels_out;_++){var o=new D;r.n_out=q(e,t[_],i.mf_size,e.framesize,a[_],s,n,o,_),r.n_in=o.num_used}else{r.n_out=Math.min(e.framesize,n),r.n_in=r.n_out;for(var l=0;l<r.n_out;++l)t[0][i.mf_size+l]=a[0][s+l],2==i.channels_out&&(t[1][i.mf_size+l]=a[1][s+l])}}this.lame_init=function(){var e=new function(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=m.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null};return 0!=function(e){var t;return e.class_id=B,t=e.internal_flags=new H,e.mode=m.NOT_SET,e.original=1,e.in_samplerate=44100,e.num_channels=2,e.num_samples=-1,e.bWriteVbrTag=!0,e.quality=-1,e.short_blocks=null,t.subblock_gain=-1,e.lowpassfreq=0,e.highpassfreq=0,e.lowpasswidth=-1,e.highpasswidth=-1,e.VBR=p.vbr_off,e.VBR_q=4,e.ATHcurve=-1,e.VBR_mean_bitrate_kbps=128,e.VBR_min_bitrate_kbps=0,e.VBR_max_bitrate_kbps=0,e.VBR_hard_min=0,t.VBR_min_bitrate=1,t.VBR_max_bitrate=13,e.quant_comp=-1,e.quant_comp_short=-1,e.msfix=-1,t.resample_ratio=1,t.OldValue[0]=180,t.OldValue[1]=180,t.CurrentStep[0]=4,t.CurrentStep[1]=4,t.masking_lower=1,t.nsPsy.attackthre=-1,t.nsPsy.attackthre_s=-1,e.scale=-1,e.athaa_type=-1,e.ATHtype=-1,e.athaa_loudapprox=-1,e.athaa_sensitivity=0,e.useTemporal=null,e.interChRatio=-1,t.mf_samples_to_encode=P.ENCDELAY+P.POSTDELAY,e.encoder_padding=0,t.mf_size=P.ENCDELAY-P.MDCTDELAY,e.findReplayGain=!1,e.decode_on_the_fly=!1,t.decode_on_the_fly=!1,t.findReplayGain=!1,t.findPeakSample=!1,t.RadioGain=0,t.AudiophileGain=0,t.noclipGainChange=0,t.noclipScale=-1,e.preset=0,e.write_id3tag_automatic=!0,0}(e)?null:(e.lame_allocated_gfp=1,e)},this.nearestBitrateFullIndex=function(e){var t=[8,16,24,32,40,48,56,64,80,96,112,128,160,192,224,256,320],a=0,s=0,n=0,r=0;r=t[16],n=16,s=t[16],a=16;for(var i=0;i<16;i++)if(Math.max(e,t[i+1])!=e){r=t[i+1],n=i+1,s=t[i],a=i;break}return r-e>e-s?a:n},this.lame_init_params=function(e){var o,R,I,H=e.internal_flags;if(H.Class_ID=0,null==H.ATH&&(H.ATH=new function(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=n(P.SBMAX_l),this.s=n(P.SBMAX_s),this.psfb21=n(P.PSFB21),this.psfb12=n(P.PSFB12),this.cb_l=n(P.CBANDS),this.cb_s=n(P.CBANDS),this.eql_w=n(P.BLKSIZE/2)}),null==H.PSY&&(H.PSY=new function(){this.mask_adjust=0,this.mask_adjust_short=0,this.bo_l_weight=n(P.SBMAX_l),this.bo_s_weight=n(P.SBMAX_s)}),null==H.rgdata&&(H.rgdata=new function(){this.linprebuf=n(2*d.MAX_ORDER),this.linpre=0,this.lstepbuf=n(d.MAX_SAMPLES_PER_WINDOW+d.MAX_ORDER),this.lstep=0,this.loutbuf=n(d.MAX_SAMPLES_PER_WINDOW+d.MAX_ORDER),this.lout=0,this.rinprebuf=n(2*d.MAX_ORDER),this.rinpre=0,this.rstepbuf=n(d.MAX_SAMPLES_PER_WINDOW+d.MAX_ORDER),this.rstep=0,this.routbuf=n(d.MAX_SAMPLES_PER_WINDOW+d.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=s(0|d.STEPS_per_dB*d.MAX_dB),this.B=s(0|d.STEPS_per_dB*d.MAX_dB)}),H.channels_in=e.num_channels,1==H.channels_in&&(e.mode=m.MONO),H.channels_out=e.mode==m.MONO?1:2,H.mode_ext=P.MPG_MD_MS_LR,e.mode==m.MONO&&(e.force_ms=!1),e.VBR==p.vbr_off&&128!=e.VBR_mean_bitrate_kbps&&0==e.brate&&(e.brate=e.VBR_mean_bitrate_kbps),e.VBR==p.vbr_off||e.VBR==p.vbr_mtrh||e.VBR==p.vbr_mt||(e.free_format=!1),e.VBR==p.vbr_off&&0==e.brate&&g.EQ(e.compression_ratio,0)&&(e.compression_ratio=11.025),e.VBR==p.vbr_off&&e.compression_ratio>0&&(0==e.out_samplerate&&(e.out_samplerate=map2MP3Frequency(int(.97*e.in_samplerate))),e.brate=0|16*e.out_samplerate*H.channels_out/(1e3*e.compression_ratio),H.samplerate_index=T(e.out_samplerate,e),e.free_format||(e.brate=E(e.brate,e.version,e.out_samplerate))),0!=e.out_samplerate&&(e.out_samplerate<16e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,64)):e.out_samplerate<32e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,160)):(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,32),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,320))),0==e.lowpassfreq){var V=16e3;switch(e.VBR){case p.vbr_off:x(L=new S,e.brate),V=L.lowerlimit;break;case p.vbr_abr:var L;x(L=new S,e.VBR_mean_bitrate_kbps),V=L.lowerlimit;break;case p.vbr_rh:var N=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=e.VBR_q&&e.VBR_q<=9){var D=N[e.VBR_q],X=N[e.VBR_q+1],q=e.VBR_q_frac;V=linear_int(D,X,q)}else V=19500;break;default:N=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=e.VBR_q&&e.VBR_q<=9){D=N[e.VBR_q],X=N[e.VBR_q+1],q=e.VBR_q_frac;V=linear_int(D,X,q)}else V=19500}e.mode!=m.MONO||e.VBR!=p.vbr_off&&e.VBR!=p.vbr_abr||(V*=1.5),e.lowpassfreq=0|V}if(0==e.out_samplerate&&(2*e.lowpassfreq>e.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=(o=0|e.lowpassfreq,R=e.in_samplerate,I=44100,R>=48e3?I=48e3:R>=44100?I=44100:R>=32e3?I=32e3:R>=24e3?I=24e3:R>=22050?I=22050:R>=16e3?I=16e3:R>=12e3?I=12e3:R>=11025?I=11025:R>=8e3&&(I=8e3),-1==o?I:(o<=15960&&(I=44100),o<=15250&&(I=32e3),o<=11220&&(I=24e3),o<=9970&&(I=22050),o<=7230&&(I=16e3),o<=5420&&(I=12e3),o<=4510&&(I=11025),o<=3970&&(I=8e3),R<I?R>44100?48e3:R>32e3?44100:R>24e3?32e3:R>22050?24e3:R>16e3?22050:R>12e3?16e3:R>11025?12e3:R>8e3?11025:8e3:I))),e.lowpassfreq=Math.min(20500,e.lowpassfreq),e.lowpassfreq=Math.min(e.out_samplerate/2,e.lowpassfreq),e.VBR==p.vbr_off&&(e.compression_ratio=16*e.out_samplerate*H.channels_out/(1e3*e.brate)),e.VBR==p.vbr_abr&&(e.compression_ratio=16*e.out_samplerate*H.channels_out/(1e3*e.VBR_mean_bitrate_kbps)),e.bWriteVbrTag||(e.findReplayGain=!1,e.decode_on_the_fly=!1,H.findPeakSample=!1),H.findReplayGain=e.findReplayGain,H.decode_on_the_fly=e.decode_on_the_fly,H.decode_on_the_fly&&(H.findPeakSample=!0),H.findReplayGain&&t.InitGainAnalysis(H.rgdata,e.out_samplerate)==d.INIT_GAIN_ANALYSIS_ERROR)return e.internal_flags=null,-6;switch(H.decode_on_the_fly&&!e.decode_only&&(null!=H.hip&&b.hip_decode_exit(H.hip),H.hip=b.hip_decode_init()),H.mode_gr=e.out_samplerate<=24e3?1:2,e.framesize=576*H.mode_gr,e.encoder_delay=P.ENCDELAY,H.resample_ratio=e.in_samplerate/e.out_samplerate,e.VBR){case p.vbr_mt:case p.vbr_rh:case p.vbr_mtrh:e.compression_ratio=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5][e.VBR_q];break;case p.vbr_abr:e.compression_ratio=16*e.out_samplerate*H.channels_out/(1e3*e.VBR_mean_bitrate_kbps);break;default:e.compression_ratio=16*e.out_samplerate*H.channels_out/(1e3*e.brate)}if(e.mode==m.NOT_SET&&(e.mode=m.JOINT_STEREO),e.highpassfreq>0?(H.highpass1=2*e.highpassfreq,e.highpasswidth>=0?H.highpass2=2*(e.highpassfreq+e.highpasswidth):H.highpass2=2*e.highpassfreq,H.highpass1/=e.out_samplerate,H.highpass2/=e.out_samplerate):(H.highpass1=0,H.highpass2=0),e.lowpassfreq>0?(H.lowpass2=2*e.lowpassfreq,e.lowpasswidth>=0?(H.lowpass1=2*(e.lowpassfreq-e.lowpasswidth),H.lowpass1<0&&(H.lowpass1=0)):H.lowpass1=2*e.lowpassfreq,H.lowpass1/=e.out_samplerate,H.lowpass2/=e.out_samplerate):(H.lowpass1=0,H.lowpass2=0),function(e){var t=e.internal_flags,a=32,s=-1;if(t.lowpass1>0){for(var n=999,r=0;r<=31;r++)(l=r/31)>=t.lowpass2&&(a=Math.min(a,r)),t.lowpass1<l&&l<t.lowpass2&&(n=Math.min(n,r));t.lowpass1=999==n?(a-.75)/31:(n-.75)/31,t.lowpass2=a/31}if(t.highpass2>0&&t.highpass2<.75/31*.9&&(t.highpass1=0,t.highpass2=0,c.err.println("Warning: highpass filter disabled. highpass frequency too small\n")),t.highpass2>0){var i=-1;for(r=0;r<=31;r++)(l=r/31)<=t.highpass1&&(s=Math.max(s,r)),t.highpass1<l&&l<t.highpass2&&(i=Math.max(i,r));t.highpass1=s/31,t.highpass2=-1==i?(s+.75)/31:(i+.75)/31}for(r=0;r<32;r++){var _,o,l=r/31;_=t.highpass2>t.highpass1?w((t.highpass2-l)/(t.highpass2-t.highpass1+1e-20)):1,o=t.lowpass2>t.lowpass1?w((l-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[r]=_*o}}(e),H.samplerate_index=T(e.out_samplerate,e),H.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==p.vbr_off){if(e.free_format)H.bitrate_index=0;else if(e.brate=E(e.brate,e.version,e.out_samplerate),H.bitrate_index=k(e.brate,e.version,e.out_samplerate),H.bitrate_index<=0)return e.internal_flags=null,-1}else H.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=H.pinfo&&(e.bWriteVbrTag=!1),a.init_bit_stream_w(H);for(var Y,C=H.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),j=0;j<P.SBMAX_l+1;j++)H.scalefac_band.l[j]=i.sfBandIndex[C].l[j];for(j=0;j<P.PSFB21+1;j++){var F=(H.scalefac_band.l[22]-H.scalefac_band.l[21])/P.PSFB21,G=H.scalefac_band.l[21]+j*F;H.scalefac_band.psfb21[j]=G}H.scalefac_band.psfb21[P.PSFB21]=576;for(j=0;j<P.SBMAX_s+1;j++)H.scalefac_band.s[j]=i.sfBandIndex[C].s[j];for(j=0;j<P.PSFB12+1;j++){F=(H.scalefac_band.s[13]-H.scalefac_band.s[12])/P.PSFB12,G=H.scalefac_band.s[12]+j*F;H.scalefac_band.psfb12[j]=G}for(H.scalefac_band.psfb12[P.PSFB12]=192,1==e.version?H.sideinfo_len=1==H.channels_out?21:36:H.sideinfo_len=1==H.channels_out?13:21,e.error_protection&&(H.sideinfo_len+=2),function(e){var t=e.internal_flags;e.frameNum=0,e.write_id3tag_automatic&&h.id3tag_write_v2(e),t.bitrate_stereoMode_Hist=_([16,5]),t.bitrate_blockType_Hist=_([16,6]),t.PeakSample=0,e.bWriteVbrTag&&f.InitVbrTag(e)}(e),H.Class_ID=B,Y=0;Y<19;Y++)H.nsPsy.pefirbuf[Y]=700*H.mode_gr*H.channels_out;switch(-1==e.ATHtype&&(e.ATHtype=4),e.VBR){case p.vbr_mt:e.VBR=p.vbr_mtrh;case p.vbr_mtrh:null==e.useTemporal&&(e.useTemporal=!1),r.apply_preset(e,500-10*e.VBR_q,0),e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),e.quality<5&&(e.quality=0),e.quality>5&&(e.quality=5),H.PSY.mask_adjust=e.maskingadjust,H.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?H.sfb21_extra=!1:H.sfb21_extra=e.out_samplerate>44e3,H.iteration_loop=new VBRNewIterationLoop(l);break;case p.vbr_rh:r.apply_preset(e,500-10*e.VBR_q,0),H.PSY.mask_adjust=e.maskingadjust,H.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?H.sfb21_extra=!1:H.sfb21_extra=e.out_samplerate>44e3,e.quality>6&&(e.quality=6),e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),H.iteration_loop=new VBROldIterationLoop(l);break;default:var z;H.sfb21_extra=!1,e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),(z=e.VBR)==p.vbr_off&&(e.VBR_mean_bitrate_kbps=e.brate),r.apply_preset(e,e.VBR_mean_bitrate_kbps,0),e.VBR=z,H.PSY.mask_adjust=e.maskingadjust,H.PSY.mask_adjust_short=e.maskingadjust_short,z==p.vbr_off?H.iteration_loop=new function(e){var t=e;this.quantize=t,this.iteration_loop=function(e,t,a,r){var i,_=e.internal_flags,o=n(y.SFBMAX),l=n(576),f=s(2),c=0,h=_.l3_side,u=new A(c);this.quantize.rv.ResvFrameBegin(e,u),c=u.bits;for(var b=0;b<_.mode_gr;b++){i=this.quantize.qupvt.on_pe(e,t,f,c,b,b),_.mode_ext==P.MPG_MD_MS_LR&&(this.quantize.ms_convert(_.l3_side,b),this.quantize.qupvt.reduce_side(f,a[b],c,i));for(var p=0;p<_.channels_out;p++){var m,d,v=h.tt[b][p];v.block_type!=P.SHORT_TYPE?(m=0,d=_.PSY.mask_adjust-m):(m=0,d=_.PSY.mask_adjust_short-m),_.masking_lower=Math.pow(10,.1*d),this.quantize.init_outer_loop(_,v),this.quantize.init_xrpow(_,v,l)&&(this.quantize.qupvt.calc_xmin(e,r[b][p],v,o),this.quantize.outer_loop(e,v,o,l,p,f[p])),this.quantize.iteration_finish_one(_,b,p)}}this.quantize.rv.ResvFrameEnd(_,c)}}(l):H.iteration_loop=new ABRIterationLoop(l)}if(e.VBR!=p.vbr_off){if(H.VBR_min_bitrate=1,H.VBR_max_bitrate=14,e.out_samplerate<16e3&&(H.VBR_max_bitrate=8),0!=e.VBR_min_bitrate_kbps&&(e.VBR_min_bitrate_kbps=E(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),H.VBR_min_bitrate=k(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),H.VBR_min_bitrate<0))return-1;if(0!=e.VBR_max_bitrate_kbps&&(e.VBR_max_bitrate_kbps=E(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),H.VBR_max_bitrate=k(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),H.VBR_max_bitrate<0))return-1;e.VBR_min_bitrate_kbps=M.bitrate_table[e.version][H.VBR_min_bitrate],e.VBR_max_bitrate_kbps=M.bitrate_table[e.version][H.VBR_max_bitrate],e.VBR_mean_bitrate_kbps=Math.min(M.bitrate_table[e.version][H.VBR_max_bitrate],e.VBR_mean_bitrate_kbps),e.VBR_mean_bitrate_kbps=Math.max(M.bitrate_table[e.version][H.VBR_min_bitrate],e.VBR_mean_bitrate_kbps)}return e.tune&&(H.PSY.mask_adjust+=e.tune_value_a,H.PSY.mask_adjust_short+=e.tune_value_a),function(e){var t=e.internal_flags;switch(e.quality){default:case 9:t.psymodel=0,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 8:e.quality=7;case 7:t.psymodel=1,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 6:case 5:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=0,t.full_outer_loop=0;break;case 4:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 3:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 2:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 1:case 0:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=2,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0}}(e),e.athaa_type<0?H.ATH.useAdjust=3:H.ATH.useAdjust=e.athaa_type,H.ATH.aaSensitivityP=Math.pow(10,e.athaa_sensitivity/-10),null==e.short_blocks&&(e.short_blocks=u.short_block_allowed),e.short_blocks!=u.short_block_allowed||e.mode!=m.JOINT_STEREO&&e.mode!=m.STEREO||(e.short_blocks=u.short_block_coupled),e.quant_comp<0&&(e.quant_comp=1),e.quant_comp_short<0&&(e.quant_comp_short=0),e.msfix<0&&(e.msfix=0),e.exp_nspsytune=1|e.exp_nspsytune,e.internal_flags.nsPsy.attackthre<0&&(e.internal_flags.nsPsy.attackthre=O.NSATTACKTHRE),e.internal_flags.nsPsy.attackthre_s<0&&(e.internal_flags.nsPsy.attackthre_s=O.NSATTACKTHRE_S),e.scale<0&&(e.scale=1),e.ATHtype<0&&(e.ATHtype=4),e.ATHcurve<0&&(e.ATHcurve=4),e.athaa_loudapprox<0&&(e.athaa_loudapprox=2),e.interChRatio<0&&(e.interChRatio=0),null==e.useTemporal&&(e.useTemporal=!0),H.slot_lag=H.frac_SpF=0,e.VBR==p.vbr_off&&(H.slot_lag=H.frac_SpF=72e3*(e.version+1)*e.brate%e.out_samplerate|0),i.iteration_init(e),v.psymodel_init(e),0},this.lame_encode_flush=function(e,t,s,n){var r,i,_,l,f=e.internal_flags,c=o([2,1152]),u=0,b=f.mf_samples_to_encode-P.POSTDELAY,p=I(e);if(f.mf_samples_to_encode<1)return 0;for(r=0,e.in_samplerate!=e.out_samplerate&&(b+=16*e.out_samplerate/e.in_samplerate),(_=e.framesize-b%e.framesize)<576&&(_+=e.framesize),e.encoder_padding=_,l=(b+_)/e.framesize;l>0&&u>=0;){var m=p-f.mf_size,d=e.frameNum;m*=e.in_samplerate,(m/=e.out_samplerate)>1152&&(m=1152),m<1&&(m=1),i=n-r,0==n&&(i=0),s+=u=this.lame_encode_buffer(e,c[0],c[1],m,t,s,i),r+=u,l-=d!=e.frameNum?1:0}if(f.mf_samples_to_encode=0,u<0)return u;if(i=n-r,0==n&&(i=0),a.flush_bitstream(e),(u=a.copy_buffer(f,t,s,i,1))<0)return u;if(s+=u,i=n-(r+=u),0==n&&(i=0),e.write_id3tag_automatic){if(h.id3tag_write_v1(e),(u=a.copy_buffer(f,t,s,i,0))<0)return u;r+=u}return r},this.lame_encode_buffer=function(e,s,r,i,_,o,l){var f=e.internal_flags,c=[null,null];if(f.Class_ID!=B)return-3;if(0==i)return 0;!function(e,t){(null==e.in_buffer_0||e.in_buffer_nsamples<t)&&(e.in_buffer_0=n(t),e.in_buffer_1=n(t),e.in_buffer_nsamples=t)}(f,i),c[0]=f.in_buffer_0,c[1]=f.in_buffer_1;for(var h=0;h<i;h++)c[0][h]=s[h],f.channels_in>1&&(c[1][h]=r[h]);return function(e,s,n,r,i,_,o){var l,f,c,h,u,b=e.internal_flags,p=0,m=[null,null],v=[null,null];if(b.Class_ID!=B)return-3;if(0==r)return 0;if((u=a.copy_buffer(b,i,_,o,0))<0)return u;if(_+=u,p+=u,v[0]=s,v[1]=n,g.NEQ(e.scale,0)&&g.NEQ(e.scale,1))for(f=0;f<r;++f)v[0][f]*=e.scale,2==b.channels_out&&(v[1][f]*=e.scale);if(g.NEQ(e.scale_left,0)&&g.NEQ(e.scale_left,1))for(f=0;f<r;++f)v[0][f]*=e.scale_left;if(g.NEQ(e.scale_right,0)&&g.NEQ(e.scale_right,1))for(f=0;f<r;++f)v[1][f]*=e.scale_right;if(2==e.num_channels&&1==b.channels_out)for(f=0;f<r;++f)v[0][f]=.5*(v[0][f]+v[1][f]),v[1][f]=0;h=I(e),m[0]=b.mfbuf[0],m[1]=b.mfbuf[1];var S=0;for(;r>0;){var R=[null,null],M=0,A=0;R[0]=v[0],R[1]=v[1];var w=new N;if(Y(e,m,R,S,r,w),M=w.n_in,A=w.n_out,b.findReplayGain&&!b.decode_on_the_fly&&t.AnalyzeSamples(b.rgdata,m[0],b.mf_size,m[1],b.mf_size,A,b.channels_out)==d.GAIN_ANALYSIS_ERROR)return-6;if(r-=M,S+=M,b.channels_out,b.mf_size+=A,b.mf_samples_to_encode<1&&(b.mf_samples_to_encode=P.ENCDELAY+P.POSTDELAY),b.mf_samples_to_encode+=A,b.mf_size>=h){var T=o-p;if(0==o&&(T=0),(l=L(e,m[0],m[1],i,_,T))<0)return l;for(_+=l,p+=l,b.mf_size-=e.framesize,b.mf_samples_to_encode-=e.framesize,c=0;c<b.channels_out;c++)for(f=0;f<b.mf_size;f++)m[c][f]=m[c][f+e.framesize]}}return p}(e,c[0],c[1],i,_,o,l)}}function L(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function N(e){return e.charCodeAt(0)<<24|e.charCodeAt(1)<<16|e.charCodeAt(2)<<8|e.charCodeAt(3)}y.SFBMAX=3*P.SBMAX_s,P.ENCDELAY=576,P.POSTDELAY=1152,P.MDCTDELAY=48,P.FFTOFFSET=224+P.MDCTDELAY,P.DECDELAY=528,P.SBLIMIT=32,P.CBANDS=64,P.SBPSY_l=21,P.SBPSY_s=12,P.SBMAX_l=22,P.SBMAX_s=13,P.PSFB21=6,P.PSFB12=6,P.BLKSIZE=1024,P.HBLKSIZE=P.BLKSIZE/2+1,P.BLKSIZE_s=256,P.HBLKSIZE_s=P.BLKSIZE_s/2+1,P.NORM_TYPE=0,P.START_TYPE=1,P.SHORT_TYPE=2,P.STOP_TYPE=3,P.MPG_MD_LR_LR=0,P.MPG_MD_LR_I=1,P.MPG_MD_MS_LR=2,P.MPG_MD_MS_I=3,P.fircoef=[-.1039435,-.1892065,5*-.0432472,-.155915,3.898045e-17,.0467745*5,.50455,.756825,.187098*5],H.MFSIZE=3456+P.ENCDELAY-P.MDCTDELAY,H.MAX_HEADER_BUF=256,H.MAX_BITS_PER_CHANNEL=4095,H.MAX_BITS_PER_GRANULE=7680,H.BPC=320,L.RIFF=N("RIFF"),L.WAVE=N("WAVE"),L.fmt_=N("fmt "),L.data=N("data"),L.readHeader=function(e){var t=new L,a=e.getUint32(0,!1);if(L.RIFF==a){e.getUint32(4,!0);if(L.WAVE==e.getUint32(8,!1)&&L.fmt_==e.getUint32(12,!1)){var s=e.getUint32(16,!0),n=20;switch(s){case 16:case 18:t.channels=e.getUint16(n+2,!0),t.sampleRate=e.getUint32(n+4,!0);break;default:throw"extended fmt chunk not implemented"}n+=s;for(var r=L.data,i=0;r!=a&&(a=e.getUint32(n,!1),i=e.getUint32(n+4,!0),r!=a);)n+=i+8;return t.dataLen=i,t.dataOffset=n+8,t}}},y.SFBMAX=3*P.SBMAX_s,a.Mp3Encoder=function(t,a,s){3!=arguments.length&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),t=1,a=44100,s=128);var n=new V,r=new function(){this.setModules=function(e,t){}},i=new d,_=new g,o=new function(){function e(e,t,a,s,n,r,i,_,o,l,f,c,h,u,b){this.vbr_q=e,this.quant_comp=t,this.quant_comp_s=a,this.expY=s,this.st_lrm=n,this.st_s=r,this.masking_adj=i,this.masking_adj_short=_,this.ath_lower=o,this.ath_curve=l,this.ath_sensitivity=f,this.interch=c,this.safejoint=h,this.sfb21mod=u,this.msfix=b}function t(e,t,a,s,n,r,i,_,o,l,f,c,h,u){this.quant_comp=t,this.quant_comp_s=a,this.safejoint=s,this.nsmsfix=n,this.st_lrm=r,this.st_s=i,this.nsbass=_,this.scale=o,this.masking_adj=l,this.ath_lower=f,this.ath_curve=c,this.interch=h,this.sfscale=u}var a;this.setModules=function(e){a=e};var s=[new e(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new e(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new e(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new e(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new e(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new e(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new e(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new e(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new e(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],n=[new e(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new e(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new e(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new e(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new e(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new e(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new e(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new e(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new e(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function r(e,t,a){var r=e.VBR==p.vbr_rh?s:n,i=e.VBR_q_frac,_=r[t],o=r[t+1],l=_;_.st_lrm=_.st_lrm+i*(o.st_lrm-_.st_lrm),_.st_s=_.st_s+i*(o.st_s-_.st_s),_.masking_adj=_.masking_adj+i*(o.masking_adj-_.masking_adj),_.masking_adj_short=_.masking_adj_short+i*(o.masking_adj_short-_.masking_adj_short),_.ath_lower=_.ath_lower+i*(o.ath_lower-_.ath_lower),_.ath_curve=_.ath_curve+i*(o.ath_curve-_.ath_curve),_.ath_sensitivity=_.ath_sensitivity+i*(o.ath_sensitivity-_.ath_sensitivity),_.interch=_.interch+i*(o.interch-_.interch),_.msfix=_.msfix+i*(o.msfix-_.msfix),function(e,t){0>t&&(t=0),9<t&&(t=9),e.VBR_q=t,e.VBR_q_frac=0}(e,l.vbr_q),0!=a?e.quant_comp=l.quant_comp:Math.abs(e.quant_comp- -1)>0||(e.quant_comp=l.quant_comp),0!=a?e.quant_comp_short=l.quant_comp_s:Math.abs(e.quant_comp_short- -1)>0||(e.quant_comp_short=l.quant_comp_s),0!=l.expY&&(e.experimentalY=0!=l.expY),0!=a?e.internal_flags.nsPsy.attackthre=l.st_lrm:Math.abs(e.internal_flags.nsPsy.attackthre- -1)>0||(e.internal_flags.nsPsy.attackthre=l.st_lrm),0!=a?e.internal_flags.nsPsy.attackthre_s=l.st_s:Math.abs(e.internal_flags.nsPsy.attackthre_s- -1)>0||(e.internal_flags.nsPsy.attackthre_s=l.st_s),0!=a?e.maskingadjust=l.masking_adj:Math.abs(e.maskingadjust-0)>0||(e.maskingadjust=l.masking_adj),0!=a?e.maskingadjust_short=l.masking_adj_short:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=l.masking_adj_short),0!=a?e.ATHlower=-l.ath_lower/10:Math.abs(10*-e.ATHlower-0)>0||(e.ATHlower=-l.ath_lower/10),0!=a?e.ATHcurve=l.ath_curve:Math.abs(e.ATHcurve- -1)>0||(e.ATHcurve=l.ath_curve),0!=a?e.athaa_sensitivity=l.ath_sensitivity:Math.abs(e.athaa_sensitivity- -1)>0||(e.athaa_sensitivity=l.ath_sensitivity),l.interch>0&&(0!=a?e.interChRatio=l.interch:Math.abs(e.interChRatio- -1)>0||(e.interChRatio=l.interch)),l.safejoint>0&&(e.exp_nspsytune=e.exp_nspsytune|l.safejoint),l.sfb21mod>0&&(e.exp_nspsytune=e.exp_nspsytune|l.sfb21mod<<20),0!=a?e.msfix=l.msfix:Math.abs(e.msfix- -1)>0||(e.msfix=l.msfix),0==a&&(e.VBR_q=t,e.VBR_q_frac=i)}var i=[new t(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new t(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new t(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new t(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new t(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new t(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new t(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new t(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new t(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new t(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new t(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new t(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new t(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new t(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new t(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new t(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new t(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function _(e,t,s){var n=t,r=a.nearestBitrateFullIndex(t);if(e.VBR=p.vbr_abr,e.VBR_mean_bitrate_kbps=n,e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,320),e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.brate=e.VBR_mean_bitrate_kbps,e.VBR_mean_bitrate_kbps>320&&(e.disable_reservoir=!0),i[r].safejoint>0&&(e.exp_nspsytune=2|e.exp_nspsytune),i[r].sfscale>0&&(e.internal_flags.noise_shaping=2),Math.abs(i[r].nsbass)>0){var _=int(4*i[r].nsbass);_<0&&(_+=64),e.exp_nspsytune=e.exp_nspsytune|_<<2}return 0!=s?e.quant_comp=i[r].quant_comp:Math.abs(e.quant_comp- -1)>0||(e.quant_comp=i[r].quant_comp),0!=s?e.quant_comp_short=i[r].quant_comp_s:Math.abs(e.quant_comp_short- -1)>0||(e.quant_comp_short=i[r].quant_comp_s),0!=s?e.msfix=i[r].nsmsfix:Math.abs(e.msfix- -1)>0||(e.msfix=i[r].nsmsfix),0!=s?e.internal_flags.nsPsy.attackthre=i[r].st_lrm:Math.abs(e.internal_flags.nsPsy.attackthre- -1)>0||(e.internal_flags.nsPsy.attackthre=i[r].st_lrm),0!=s?e.internal_flags.nsPsy.attackthre_s=i[r].st_s:Math.abs(e.internal_flags.nsPsy.attackthre_s- -1)>0||(e.internal_flags.nsPsy.attackthre_s=i[r].st_s),0!=s?e.scale=i[r].scale:Math.abs(e.scale- -1)>0||(e.scale=i[r].scale),0!=s?e.maskingadjust=i[r].masking_adj:Math.abs(e.maskingadjust-0)>0||(e.maskingadjust=i[r].masking_adj),i[r].masking_adj>0?0!=s?e.maskingadjust_short=.9*i[r].masking_adj:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=.9*i[r].masking_adj):0!=s?e.maskingadjust_short=1.1*i[r].masking_adj:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=1.1*i[r].masking_adj),0!=s?e.ATHlower=-i[r].ath_lower/10:Math.abs(10*-e.ATHlower-0)>0||(e.ATHlower=-i[r].ath_lower/10),0!=s?e.ATHcurve=i[r].ath_curve:Math.abs(e.ATHcurve- -1)>0||(e.ATHcurve=i[r].ath_curve),0!=s?e.interChRatio=i[r].interch:Math.abs(e.interChRatio- -1)>0||(e.interChRatio=i[r].interch),t}this.apply_preset=function(e,t,a){switch(t){case V.R3MIX:t=V.V3,e.VBR=p.vbr_mtrh;break;case V.MEDIUM:t=V.V4,e.VBR=p.vbr_rh;break;case V.MEDIUM_FAST:t=V.V4,e.VBR=p.vbr_mtrh;break;case V.STANDARD:t=V.V2,e.VBR=p.vbr_rh;break;case V.STANDARD_FAST:t=V.V2,e.VBR=p.vbr_mtrh;break;case V.EXTREME:t=V.V0,e.VBR=p.vbr_rh;break;case V.EXTREME_FAST:t=V.V0,e.VBR=p.vbr_mtrh;break;case V.INSANE:return t=320,e.preset=t,_(e,t,a),e.VBR=p.vbr_off,t}switch(e.preset=t,t){case V.V9:return r(e,9,a),t;case V.V8:return r(e,8,a),t;case V.V7:return r(e,7,a),t;case V.V6:return r(e,6,a),t;case V.V5:return r(e,5,a),t;case V.V4:return r(e,4,a),t;case V.V3:return r(e,3,a),t;case V.V2:return r(e,2,a),t;case V.V1:return r(e,1,a),t;case V.V0:return r(e,0,a),t}return 8<=t&&t<=320?_(e,t,a):(e.preset=0,t)}},l=new T,f=new k,c=new S,h=new function(){this.getLameVersion=function(){return"3.98.4"},this.getLameShortVersion=function(){return"3.98.4"},this.getLameVeryShortVersion=function(){return"LAME3.98r"},this.getPsyVersion=function(){return"0.93"},this.getLameUrl=function(){return"http://www.mp3dev.org/"},this.getLameOsBitness=function(){return"32bits"}},u=new function(){this.setModules=function(e,t){}},b=new function(){var e;this.setModules=function(t){e=t},this.ResvFrameBegin=function(t,a){var s,n=t.internal_flags,r=n.l3_side,i=e.getframebits(t);a.bits=(i-8*n.sideinfo_len)/n.mode_gr;var _=2048*n.mode_gr-8;t.brate>320?s=8*int(1e3*t.brate/(t.out_samplerate/1152)/8+.5):(s=11520,t.strict_ISO&&(s=8*int(32e4/(t.out_samplerate/1152)/8+.5))),n.ResvMax=s-i,n.ResvMax>_&&(n.ResvMax=_),(n.ResvMax<0||t.disable_reservoir)&&(n.ResvMax=0);var o=a.bits*n.mode_gr+Math.min(n.ResvSize,n.ResvMax);return o>s&&(o=s),r.resvDrain_pre=0,null!=n.pinfo&&(n.pinfo.mean_bits=a.bits/2,n.pinfo.resvsize=n.ResvSize),o},this.ResvMaxBits=function(e,t,a,s){var n,r=e.internal_flags,i=r.ResvSize,_=r.ResvMax;0!=s&&(i+=t),0!=(1&r.substep_shaping)&&(_*=.9),a.bits=t,10*i>9*_?(n=i-9*_/10,a.bits+=n,r.substep_shaping|=128):(n=0,r.substep_shaping&=127,e.disable_reservoir||0!=(1&r.substep_shaping)||(a.bits-=.1*t));var o=i<6*r.ResvMax/10?i:6*r.ResvMax/10;return(o-=n)<0&&(o=0),o},this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var a,s=e.l3_side;e.ResvSize+=t*e.mode_gr;var n=0;s.resvDrain_post=0,s.resvDrain_pre=0,0!=(a=e.ResvSize%8)&&(n+=a),(a=e.ResvSize-n-e.ResvMax)>0&&(n+=a);var r=Math.min(8*s.main_data_begin,n)/8;s.resvDrain_pre+=8*r,n-=8*r,e.ResvSize-=8*r,s.main_data_begin-=r,s.resvDrain_post+=n,e.ResvSize-=n}},R=new v,M=new function(){this.setModules=function(e,t,a){}},A=new function(){};n.setModules(i,_,o,l,f,c,h,u,A),_.setModules(i,A,h,c),u.setModules(_,h),o.setModules(n),f.setModules(_,b,l,R),l.setModules(R,b,n.enc.psy),b.setModules(_),R.setModules(l),c.setModules(n,_,h),r.setModules(M,A),M.setModules(h,u,o);var B=n.lame_init();B.num_channels=t,B.in_samplerate=a,B.brate=s,B.mode=m.STEREO,B.quality=3,B.bWriteVbrTag=!1,B.disable_reservoir=!0,B.write_id3tag_automatic=!1,n.lame_init_params(B);var w=1152,E=0|1.25*w+7200,y=e(E);this.encodeBuffer=function(a,s){1==t&&(s=a),a.length>w&&(w=a.length,y=e(E=0|1.25*w+7200));var r=n.lame_encode_buffer(B,a,s,a.length,y,0,E);return new Int8Array(y.subarray(0,r))},this.flush=function(){var e=n.lame_encode_flush(B,y,0,E);return new Int8Array(y.subarray(0,e))}},a.WavHeader=L}a();var s=[],n=new a.Mp3Encoder(1,48e3,128);e.capture();var i=new Int16Array(e.data.map(function(e){return 4e3*e})),_=n.encodeBuffer(i);return s.push(_),_=n.flush(),s.push(_),new Promise(function(e){if(t.includes("file"))return new File(s,{type:"audio/mp3"});if(t.includes("blob")&&r(new Blob(s,{type:"audio/mp3"})),t.includes("url")){let t=new FileReader;t.readAsDataURL(new Blob(s,{type:"audio/mp3"})),t.onload=function(){e(t.result)}}(t.includes("text")||t.includes("string"))&&e(String.fromCharCode.apply(String,s[0])+String.fromCharCode.apply(String,s[1]))})}),Synth.presetVoices=Object.keys(t),Synth.VOICEMAKER="https://000642670.codepen.website/helpers.html?action=voicemaker"}();

Back to list