Static p5_sys::global::createAudio [−][src]
pub static createAudio: CreateAudioInternalType
Expand description
Creates a hidden HTML5
Examples
let ele; function setup() { ele = createAudio('assets/beat.mp3'); // here we set the element to autoplay // The element will play as soon // as it is able to do so. ele.autoplay(true); }
Parameters
src?
path to an audio file, or array of paths
for supporting different browsers
callback?
callback function to be called upon
‘canplaythrough’ event fire, that is, when the
browser can play the media, and estimates that
enough data has been loaded to play the media
up to its end without having to stop for
further buffering of content