index.html 962 B

123456789101112131415161718192021222324252627282930313233343536
  1. <!doctype html>
  2. <meta charset="UTF-8" />
  3. <html lang="en">
  4. <head>
  5. <title>noise roulette</title>
  6. </head>
  7. <body>
  8. <h1>
  9. Noise Roulette
  10. </h1>
  11. <p>
  12. Play random audio tracks in parallel
  13. </p>
  14. <audio controls autoplay></audio>
  15. <audio controls autoplay></audio>
  16. <audio controls autoplay></audio>
  17. <audio controls autoplay></audio>
  18. <audio controls autoplay></audio>
  19. <audio controls autoplay></audio>
  20. <audio controls autoplay></audio>
  21. <audio controls autoplay></audio>
  22. <!-- add as many audio players you like -->
  23. <script>
  24. // the list of the tracks to choose from:
  25. var noise=["1.mp3","2.mp3","3.mp3"];
  26. [].slice.call(document.getElementsByTagName("audio")).map(
  27. (player)=> {
  28. player.src=noise[Math.floor(Math.random()*noise.length)]
  29. player.onended = ()=> {
  30. player.src = noise[Math.floor(Math.random()*noise.length)] }})
  31. </script>
  32. </body>
  33. </html>