createAudio() creates an audio player. This example displays the player’s controls and adjusts its speed. The playback speed is normal when the mouse is on the left edge of the window, and it gets faster as the mouse moves to the right. More information on using media elements such as audio players is on the p5.MediaElement reference page. The audio file is a public domain piano loop by Josef Pres.
Audio Player by p5.js Contributors and the Processing Foundation is licensed under CC BY-NC-SA 4.0.