问题
I tried this code in IE10 it works fine but not in Chrome or Firefox, if we made a call directly for the Google tts API URL in the Chrome or Firefox browser, it works first time only and then it will only load the same text from the script, if any change for the submitted text has happened from the script, no reading will occur. see the example below please!
<head>
<script>
// audio= new Audio();
function playit() {
var toread=document.getElementById('texttoread').value;
var audio = new Audio();
audio.src = 'http://translate.google.com/translate_tts?rel=noreferrer&ie=UTF-8&tl=en&q='+toread;
// audio.load();
audio.play();
}
</script>
</head>
<body>
<input id="texttoread"
type="text"
value="say"
/>
<input
type="button"
value="say hi"
onclick="playit()"
/>
</body>
If any one can tell, that the incoming media will be saved to some sort of file or cashed, and this data somehow not directly rewritable again, what i believe is must be some kind of reset or clear.
来源:https://stackoverflow.com/questions/22242155/is-chrome-and-firefox-do-not-load-the-change-in-media-source