瀏覽代碼

Tweak looping sources to maybe fix a popping problem

master
Fen Dweller 4 年之前
父節點
當前提交
306835c5f2
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. +2
    -4
      src/sources/LoopingSource.ts

+ 2
- 4
src/sources/LoopingSource.ts 查看文件

@@ -44,10 +44,8 @@ export class LoopingSource extends Source {
this.source = context.createBufferSource();
this.source.buffer = this.soundSet.soundList[index];
this.source.connect(this.gain);
this.source.onended = () => {
this.pickRandom();
this.source.start();
};
this.source.loop = true;
this.source.loopEnd = this.source.buffer.duration - 0.1;
}
public tick(dt: number): void {
super.tick(dt);


Loading…
取消
儲存