From f6b17ccbd249e6a5c5b2ac4c44040c5fff6b55fb Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 6 Apr 2018 02:17:39 +0200 Subject: [PATCH] [fuck] bigfix ta mere --- webpack/lib/audio-manager.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/webpack/lib/audio-manager.js b/webpack/lib/audio-manager.js index 1eebac2..d27a784 100644 --- a/webpack/lib/audio-manager.js +++ b/webpack/lib/audio-manager.js @@ -69,7 +69,7 @@ export default class AudioManager{ // WILL BE DONE ON receive() /* (1) Finally connect to OUTPUT */ - current_node.connect(this.gain); + // current_node.connect(this.gain); this.gain.connect(this.output); } @@ -94,14 +94,13 @@ export default class AudioManager{ /*DEBUG*///window.timer = new Date().getTime(); let buf32 = new Float32Array(AudioManager.BUFFER_SIZE); + // _audioprocess.inputBuffer.copyFromChannel(buf32, 0); _audioprocess.inputBuffer.copyFromChannel(buf32, 0); let buf16 = this.f32toi16(buf32); - if( this.ws && this.ws.readyState === 1 ) - console.log(`send buffer[${buf16.length}]`); - else - console.log(`websocket not connected`); + if( this.ws && this.ws.readyState === 1 ) console.log(`send buffer[${buf16.length}]`); + else console.log(`websocket not connected`); this.ws && this.ws.send(buf16); } @@ -114,17 +113,18 @@ export default class AudioManager{ let buf32 = this.i16tof32(_buffer); /* (2) Create source node */ - this.network.in = this.ctx.createBufferSource(); + let source = this.ctx.createBufferSource(); /* (3) Create buffer and dump data */ let input_buffer = this.ctx.createBuffer(1, AudioManager.BUFFER_SIZE, this.ctx.sampleRate); input_buffer.getChannelData(0).set(buf32); /* (4) Pass buffer to source node */ - this.network.in.buffer = input_buffer; + source.buffer = input_buffer; /* (5) Connect and play audio */ - this.network.in.connect(this.gain); + source.connect(this.gain); + source.start(0); } @@ -188,7 +188,6 @@ export default class AudioManager{ /* (2) Manage websocket responses */ this.ws.onmessage = function(_msg){ - console.warn(`received`, _msg.data); if( !(_msg.data instanceof Blob) ) return console.warn('[NaB] Not A Blob');