I am trying to assign a different sound to each word in the "listOfWords" I dont know where to go from here in regards to printing one of the words randomly with the sound clip playing as it is produced..
var listOfWords = {
"mat": "http://www.wav-sounds.com/cartoon/daffyduck1.wav",
"cat": "http://www.wav-sounds.com/cartoon/hankhill1.wav",
"dog": "http://www.wav-sounds.com/cartoon/bugsbunny1.wav",
"pit": "http://www.wav-sounds.com/cartoon/familyguy2.wav",
"pot": "http://www.wav-sounds.com/cartoon/porkypig1.wav"
}
Here I have the random generation I have tried so far..
var shuffledWords = listOfWords.slice(0).sort(function() {
return 0.5 - Math.random();
}).slice(0, 1);