Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
p.setup = () => {
this.canvas = p.createCanvas(window.innerWidth, window.innerHeight);
if (this.state.mode === "mic") {
this.mic = new p5.AudioIn();
this.mic.start();
this.fft = new p5.FFT();
this.fft.setInput(this.mic);
} else {
// using a song file
this.song.setVolume(1.0);
this.song.playMode("restart");
this.song.play();
this.fft = new p5.FFT();
this.fft.setInput(this.song);
}
};