Я вижу, что это было задано давно, но я пришел к аналогичной проблеме, и мне удалось заставить его работать для Chrome и Firefox, но с помощью Audio Tag.
Вот демонстрационная страница Я сделал
http://jsfiddle.net/royriojas/SE6ET/
здесь код, который сделал трюк для меня ...
var sayIt;
function createSayIt() {
// Tiny trick to make the request to google actually work!, they deny the request if it comes from a page but somehow it works when the function is inside this iframe!
//create an iframe without setting the src attribute
var iframe = document.createElement('iframe');
// don't know if the attribute is required, but it was on the codepen page where this code worked, so I just put this here. Might be not needed.
iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-pointer-lock');
// hide the iframe... cause you know, it is ugly letting iframes be visible around...
iframe.setAttribute('class', 'hidden-iframe')
// append it to the body
document.body.appendChild(iframe);
// obtain a reference to the contentWindow
var v = iframe.contentWindow;
// parse the sayIt function in this contentWindow scope
// Yeah, I know eval is evil, but its evilness fixed this issue...
v.eval("function sayIt(query, language, cb) { var audio = new Audio(); audio.src = 'http://translate.google.com/translate_tts?ie=utf-8&tl=' + language + '&q=' + encodeURIComponent(query); cb && audio.addEventListener('ended', cb); audio.play();}");
// export it under sayIt variable
sayIt = v.sayIt;
}
Я думаю, что я был в состоянии Bypass, что ограничение. Они могли бы исправить этот взлом в будущем, которого я не знаю. Я на самом деле надеюсь, что они не ...
Вы также можете попробовать использовать апи Text2Speech HTML5, но это все еще очень молодой ...
IE 11 не работает с этим хака, некоторое время в в будущем я могу попытаться исправить это