Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions