diff --git a/public/js/pcm-player.js b/public/js/pcm-player.js index 7611a3d..0014f10 100644 --- a/public/js/pcm-player.js +++ b/public/js/pcm-player.js @@ -1 +1 @@ -function PCMPlayer(t){this.init(t)}PCMPlayer.prototype.init=function(){this.audioCtx=new(window.AudioContext||window.webkitAudioContext)({sampleRate:44100}),this.audioCtx.resume(),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioCtx.destination),this.startTime=this.audioCtx.currentTime},PCMPlayer.prototype.feed=function(t){t=new Float32Array(t);let i=this.audioCtx.createBufferSource(),e=t.length/2,a=this.audioCtx.createBuffer(2,e,44100),o,n,s=a.getChannelData(0),r=0;for(o=0;o