Hoi_A

Looping Wheel Sound code for Jevin

Aug 28th, 2015
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. so, first we move the code that adds the music
  2. //
  3. var wheelMusic = new Audio('sound.mp3');
  4. //
  5. to the variables -> http://puu.sh/jRL64/d992ecb2ad.png
  6.  
  7. then we move the code that starts and loops the music
  8. //
  9. wheelMusic.loop = true;
  10. wheelMusic.play();
  11. //
  12. into the startSpin function -> http://puu.sh/jRLdo/7e55fe67e2.png
  13.  
  14. then we move the code that ends it
  15. //
  16. wheelMusic.currentTime = 0;
  17. wheelMusic.pause();
  18. //
  19. into the doSpin function -> http://puu.sh/jRLo8/51956f6901.png
  20.  
  21. note that sound.mp3 needs to be named to your sound file (or you name the sound file sound.mp3, whatever works best)
Advertisement
Add Comment
Please, Sign In to add comment