Question: Make a round audio visualizer that looks like paint or some other liquid in Javascript using the p5 Library. It is supposed to look as

Make a round audio visualizer that looks like paint or some other liquid in Javascript using the p5 Library.

It is supposed to look as though it is pulsing along the music

Be sure to use the audio class to include a sound into the program that starts playing when clicked on, then stops if you click again.

Below is a snippet of code that may help:

var song;

function setup() { song = loadSound('assets/lucky_dragons_-_power_melody.mp3'); createCanvas(720, 200); background(255,0,0); }

function mousePressed() { if ( song.isPlaying() ) { // .isPlaying() returns a boolean song.stop(); background(255,0,0); } else { song.play(); background(0,255,0); } }

To use the Audio Classes, you will need the p5.sound library a sound file, and a running local server. The easiest way to do so is with a PHP local web Server.

Make an audio visualizer that looks like paint on an audio speaker in Javascript using the p5 Library.

It is supposed to look as though it is pulsing along the music

Be sure to use the audio class to include a sound into the program that starts playing when clicked on, then stops if you click again.

Below is a snippet of code that may help:

var song;

function setup() { song = loadSound('assets/lucky_dragons_-_power_melody.mp3'); createCanvas(720, 200); background(255,0,0); }

function mousePressed() { if ( song.isPlaying() ) { // .isPlaying() returns a boolean song.stop(); background(255,0,0); } else { song.play(); background(0,255,0); } }

To use the Audio Classes, you will need the p5.sound library a sound file, and a running local server. The easiest way to do so is with a PHP local web Server.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!