var play = function(){ source = context.createBufferSource(); destination = context.destination; source.buffer = buffer; source.connect(destination); source.start(0); } var stop = function(){ source.stop(0); }