How to use the p5.AudioIn function in p5

To help you get started, we’ve selected a few p5 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ccorcos / circle / src / sketch.js View on Github external
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);
      }
    };

p5

[![npm version](https://badge.fury.io/js/p5.svg)](https://www.npmjs.com/package/p5)

LGPL-2.1
Latest version published 24 days ago

Package Health Score

95 / 100
Full package analysis