I have a bit of code in javascript that generates a wav file and then attaches it to a button so it can be played:
function makeWav(){
$.get(("../testsound/getsound.pl?text="+document.myform.outputtext.value));
setTimeout(callback, 500);
return false;
}
function callback() {
var audio = new Audio('http://www.joereddington.com/testsound/hope.wav');
audio.load();
audio.play();
// $("#player").html("<embed src=http://www.joereddington.com/testsound/hope.wav autostart=true >");
}
Obviously the hope.wav file changes very regularly. But my problem is that only the first .wav to be generated is played unless I completely reload the site each time. How do I make the (presumably) callback function go and get a new version of the .wav rather than the cache?
EDIT: Works fine on the iPad - I'm having this problem in firefox.