chCharly Posted May 26, 2020 Share Posted May 26, 2020 Hi, I'm just starting with coding, and I decided to make a metronome-like bouncing ball project to explore and learn about it, the problem is that I can't get my code to trigger the bouncing sound, I don't know if I'm doing something wrong, please help! See the Pen NWGeQKx by chcharly (@chcharly) on CodePen Link to comment Share on other sites More sharing options...
OSUblake Posted May 26, 2020 Share Posted May 26, 2020 You're creating a new audio object on every call. Create your audio ONCE, and then play it in callback. 1 1 Link to comment Share on other sites More sharing options...
chCharly Posted May 26, 2020 Author Share Posted May 26, 2020 Thank you very much for the reply, I don't think I know exactly what to do to create audio once, and I think that the callback step is done, don't really understand it well yet tho, but I think it's now working... Well, sort of, it kind of sucks how it is synced, is there a way to fix it? Again thank you for your help! Link to comment Share on other sites More sharing options...
ZachSaucier Posted May 26, 2020 Share Posted May 26, 2020 2 minutes ago, chCharly said: it kind of sucks how it is synced, is there a way to fix it? You could edit the audio clip or manipulate it with JS (change the play rate, etc.). 1 Link to comment Share on other sites More sharing options...
chCharly Posted May 26, 2020 Author Share Posted May 26, 2020 Thank you for the reply, I will make the research, sorry for the noob questions... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now