Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createAnalyser(): void {
const analyser = Howler.ctx.createAnalyser();
Howler.masterGain.connect(analyser);
this.analyserChange.next(analyser);
}
setup() {
const canvas = document.getElementsByTagName('canvas')[0];
this.WIDTH = canvas.width;
this.HEIGHT = canvas.height;
this.analyser = Howler.ctx.createAnalyser();
Howler.masterGain.connect(this.analyser);
this.analyser.connect(Howler.ctx.destination);
this.canvasCtx = canvas.getContext("2d");
this.analyser.fftSize = 256;
this.bufferLength = this.analyser.frequencyBinCount;
this.dataArray = new Uint8Array(this.bufferLength);
}