Am able to play sound with javascript through the following,
var snd = new Audio('sound.wav');
snd.play();
This plays the required sound but sometimes it loads slowly or might not even load at all so i encoded the sound in base 64 and tried to play it this way.
var splash = {
prefix: "data:audio/wav;base64,",
sound: [ "*base64 string here*" ] };
var snd = new Audio(splash);
snd.play();
but the sound does not play, is there a way around it ?