function onload() { /* Create sound with url. * Note that sound is not actually loaded yet. So it is * recommended that you create all sounds that will be used * later and load them when necessary. If the sound is not * loaded when play, it will automatically load. * * Each element div can contain at most one sound. * You may set those divs to be invisible if you wish. */ var engine = new jWebAudio.SoundEngine(); var source = engine.addSoundSource({ 'url': 'resource/a.ogg' }); source.load(function() { /* Play sound instantly */ source.sound.play(); }); }