diff --git a/assets/runtime-codes/lib.transform.wav2other.js b/assets/runtime-codes/lib.transform.wav2other.js index 0a5cd26..3087241 100644 --- a/assets/runtime-codes/lib.transform.wav2other.js +++ b/assets/runtime-codes/lib.transform.wav2other.js @@ -32,7 +32,7 @@ Recorder.Wav2Other=function(newSet,wavBlob,True,False){ var bitRate=wavView[34]+(wavView[35]<<8); console.log("wav info",sampleRate,bitRate); if(bitRate==16){ - pcm=new Int16Array(wavView.slice(44).buffer); + pcm=new Int16Array(wavView.buffer.slice(44)); }else if(bitRate==8){ pcm=new Int16Array(wavView.length-44); //8位转成16位 diff --git a/assets/zdemo.index.webrtc.js b/assets/zdemo.index.webrtc.js index b432805..15a754d 100644 --- a/assets/zdemo.index.webrtc.js +++ b/assets/zdemo.index.webrtc.js @@ -487,7 +487,7 @@ var rtcDecodePlay=function(decode){ duration=pd; //分别去掉首尾,(尾并保留一点,方便衔接) var skip=Math.floor((sd-pd)/1000*raw.sampleRate/2); - arr=pcm.slice(skip,pcm.length-skip/2); + arr=new Float32Array(pcm.subarray(skip,pcm.length-skip/2));//低版本没有slice }else{ //数据少了不管 }; diff --git "a/assets/\345\267\245\345\205\267-\350\243\270PCM\350\275\254WAV\346\222\255\346\224\276\346\265\213\350\257\225.html" "b/assets/\345\267\245\345\205\267-\350\243\270PCM\350\275\254WAV\346\222\255\346\224\276\346\265\213\350\257\225.html" index 707bfd4..275efe2 100644 --- "a/assets/\345\267\245\345\205\267-\350\243\270PCM\350\275\254WAV\346\222\255\346\224\276\346\265\213\350\257\225.html" +++ "b/assets/\345\267\245\345\205\267-\350\243\270PCM\350\275\254WAV\346\222\255\346\224\276\346\265\213\350\257\225.html" @@ -16,9 +16,10 @@
w&&(o[b][m/3]=m%3+1);for(m=1;m<4;m++){var H=M[m-1],V=M[m];Math.max(H,V)<4e4&&H<1.7*V&&V<1.7*H&&(1==m&&o[b][0]<=o[b][m]&&(o[b][0]=0),o[b][m]=0)}o[b][0]<=c.nsPsy.lastAttacks[b]&&(o[b][0]=0),3!=c.nsPsy.lastAttacks[b]&&o[b][0]+o[b][1]+o[b][2]+o[b][3]==0||((T=0)!=o[b][1]&&0!=o[b][0]&&(o[b][1]=0),0!=o[b][2]&&0!=o[b][1]&&(o[b][2]=0),0!=o[b][3]&&0!=o[b][2]&&(o[b][3]=0)),b<2?l[b]=T:0==T&&(l[0]=l[1]=0),i[b]=c.tot_ener[b]}}(e,t,a,s,n,r,o,M,A,B),function(e,t){var a=e.internal_flags;e.short_blocks!=Ee.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var s=0;s w&&(o[b][m/3]=m%3+1);for(m=1;m<4;m++){var H=M[m-1],V=M[m];Math.max(H,V)<4e4&&H<1.7*V&&V<1.7*H&&(1==m&&o[b][0]<=o[b][m]&&(o[b][0]=0),o[b][m]=0)}o[b][0]<=c.nsPsy.lastAttacks[b]&&(o[b][0]=0),3!=c.nsPsy.lastAttacks[b]&&o[b][0]+o[b][1]+o[b][2]+o[b][3]==0||((T=0)!=o[b][1]&&0!=o[b][0]&&(o[b][1]=0),0!=o[b][2]&&0!=o[b][1]&&(o[b][2]=0),0!=o[b][3]&&0!=o[b][2]&&(o[b][3]=0)),b<2?l[b]=T:0==T&&(l[0]=l[1]=0),i[b]=c.tot_ener[b]}}(e,t,a,s,n,r,o,M,A,B),function(e,t){var a=e.internal_flags;e.short_blocks!=Ee.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var s=0;s=t.lowpass2&&(a=Math.min(a,r)),t.lowpass1>1;S=v/m,R=E;do{var T,k;B+=T=f[_]*f[_],R+=Ts[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 n=0,r=t.s,i=e.l3_enc;if(r>e.count1)for(;0!=a--;){o=e.xr[r],r++,n+=o*o,o=e.xr[r],r++,n+=o*o}else if(r>e.big_values){var _=we(2);for(_[0]=0,_[1]=s;0!=a--;){o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o,o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o}}else for(;0!=a--;){var o;o=Math.abs(e.xr[r])-p[i[r]]*s,r++,n+=o*o,o=Math.abs(e.xr[r])-p[i[r]]*s,r++,n+=o*o}return t.s=r,n},this.calc_noise=function(e,t,a,s,n){var r,i,_=0,o=0,l=0,f=0,c=0,h=-20,u=0,b=e.scalefac,p=0;for(r=s.over_SSD=0;r=s?e.ATH.adjust=s:e.ATH.adjust=t.lowpass2&&(a=Math.min(a,r)),t.lowpass1