Skip to content

Commit

Permalink
修复ogg错误循环
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuecn committed Dec 26, 2018
1 parent 4f1fab8 commit 5db6489
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/engine/beta-ogg.js

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/engine/beta-ogg.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ Recorder.prototype.ogg=function(res,True,False){
var idx=0;
var run=function(){
if(idx<size){
var buf=res.subarray(idx,idx+blockSize);
var floatBuf=new Float32Array(set.sampleRate);
for(var j=0;j<size;j++){
var s=buf[j];
var floatBuf=new Float32Array(idx+blockSize>=size?size-(idx+1):blockSize);
for(var i=0,j=idx,len=idx+floatBuf.length;j<len;j++,i++){
var s=res[j];
s=s<0?s/0x8000:s/0x7FFF;
floatBuf[j]=s;
floatBuf[i]=s;
};
ogg.encode([floatBuf]);

Expand Down

0 comments on commit 5db6489

Please sign in to comment.