From 066cae054ed44d177195abd5af6abc902d4e1d7b Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 10 Apr 2018 01:07:57 +0200 Subject: [PATCH] [lib.audio-manager] chromium/webkit final patch --- parcel/lib/audio-manager.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/parcel/lib/audio-manager.js b/parcel/lib/audio-manager.js index 327b098..be439d5 100644 --- a/parcel/lib/audio-manager.js +++ b/parcel/lib/audio-manager.js @@ -54,7 +54,6 @@ export default class AudioManager{ /* (5) Bind network controller to send() function */ this.network.out.onaudioprocess = this.send.bind(this); - /*Chrome fix*/this.network.out.connect(this.output); /* (6) Set up our filters' parameters */ this.setUpFilters(); @@ -162,6 +161,7 @@ export default class AudioManager{ /* (2) Also link to analyser */ this.input.connect(this.analyser); + /*Chrome fix*/this.network.out.connect(this.output); /* (3) Get first filter */ let first_filter = this.filters.voice_clarity; @@ -403,7 +403,7 @@ export default class AudioManager{ }.bind(this); /* (3) Debug */ - this.ws.onopen = () => gs.get.audio_conn !== 2 && (gs.get.audio_conn = 1); // listening + this.ws.onopen = () => (gs.get.audio_conn !== 2 && (gs.get.audio_conn = 1)); // listening this.ws.onclose = () => ( gs.get.audio_conn = null ); // disconnected @@ -424,9 +424,10 @@ export default class AudioManager{ this.recorder = new MediaRecorder(stream); - this.bindRecorderStream(stream); - - this.recorder.onstart = () => console.warn('[audio] recording'); + this.recorder.onstart = function(){ + this.bindRecorderStream(stream); + console.warn('[audio] recording'); + }.bind(this); this.recorder.onstop = () => { this.recorder.stream.getTracks().map( t => t.stop() );