17.2: Play and Pause Button - p5.js Sound Tutorial

preview_player
Показать описание


References:

Timestamps:
0:00 Introduction
0:25 There must be a reference to the p5.Sound library
1:38 Add a button to start/stop song
2:03 Write a function that will control the playback of the song
5:50 stop() versus pause()
6:00 Outro

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

#sound #mp3 #p5js
=====================================================
Рекомендации по теме
Комментарии
Автор

I don't even know what I'd do without your videos! Can't thank you enough. I'm working through the p5.js course in Kadenze and every time I hit a brick wall I turn to your tutorials.

annasavery
Автор

Thank you!
You helped me, I did not know about button.html("Button Name")

Krazy
Автор

the pause() function acts like the stop() function now for some reason. I used the exact same code, but when I click the "play" button to resume the song it starts from the beginning.
edit: the pause() function only works as shown in the video if you use createAudio() instead of loadSound().

TheRogue
Автор

*_Im subscriber #1, 000, 000 I love your videos!_*

elanonimatov
Автор

my code is not working? see:

var button;

function setup() {
createCanvas(400, 400);
button = createButton("hello");
button.mousePressed(f);
}

function draw() {
background(0, 0, 255);
}

function f() {
ellipse(200, 200, 60, 60)
}

please tell what is wrong in this?

bhavyabadhwar
Автор

Thanks best information provided by you

thenews
Автор

Hi, Shiffman. Can I share this video to Bilibili, a Chinese website, so as to let Chinese learners have the access to study P5js? In China, youtube is not available. Thanks for your consideration! Love u.

danielheart
Автор

praise be to go god 4 ur existance!! coding drunk now only because this makes it so simple

mattkaczmarczyk
Автор

as the 6:13 Dan; i want this to change to pause
Internet; okay...

endernamikaze
Автор

Nice video!!!
Why is the canvas necessary to rotate the sound?

Anonimousxz
Автор

Sir Dan, please remake this one in pure java program without library please🙏

JehanSaren
Автор

Can you show how to add the libary to your project

mayatomarchio
Автор

Would this also work if I were to use this code to play and pause a game?

qtasma
Автор

mousePressed is not working ?
for example;
function setup() {
createCanvas(400, 400);
button = createButton("word");
//line4
}
function presss(){
console.log("hi");
}


TypeError: b.bind is not a function (sketch: line 4)

maliozers
Автор

nice
try to make tins in processing I3

ibrarahmed
Автор

Sir can please make a video on how to make a video player in p5.js.

darshanthakare
Автор

it is showing that else is an unexpected token

atheshkumar.p
Автор

Bro, I want your help
How to read text using voice (sound symbol)

banothram
Автор

how did you got black screen? I can't see clear with white

aleandromarianecci
Автор

Man keep the comedy to comedians, you are not funny at all...

AP-gcss