Load a wav file and store it to the buffer.
T("wav", src="public/audio/amen.wav", loop=true).load(); // src [String] The url of an wav file to load // loop [Boolean] Looping
wav.src // [String] The url of an wav file to load wav.loop // [Boolean] Looping wav.currentTime // [Number] Current position in msec of the buffer wav.reversed // [Boolean] Play backwards wav.isLoaded // [Readonly] 'true' when loaded wav and stored wav.duration // [Readonly] The duration of the buffer
// Async load an wav file and store it to the buffer wav.load(); // Return new T("wav") instance which refers to the same buffer wav.clone(); // Return new T("wav") instance which has the extracted buffer wav.slice(begin=0, end=1000);
// Script to be run when the buffer has reach the end wav.onended = function() {}; // Script to be run when the buffer has reach the end and loop wav.onlooped = function() {}; // Scripts to be run when the meta data is loaded wav.onloadedmetadata = function(res) {}; // Scripts to be run when an audio data is loaded wav.onloadeddata = function(res) {}; // Scripts to be run when an error occurs when the file is being loaded wav.onerror = function() {};
wav.clone().set("reversed", true).play();
wav.slice(280, 280+214).play();