0

I found this question in stackoverflow. I tried to do the same but it does not work.

<html>

<body>
<script type="text/javascript">
var audio = new Audio();
audio.src ='https://translate.google.com/translate_tts?ie=utf-8&tl=en&q=Hello%20World';
audio.play();    
</script>
</body>
</html>

Could you tell me what was wrong?

Community
  • 1
  • 1
Tum
  • 3,614
  • 5
  • 38
  • 63

1 Answers1

1

The problem is a security feature Google has implemented for cross-domain protection.

It is still possible to do what you want though. Just make sure your rel tags are set up properly.

Read this question for more information.

Community
  • 1
  • 1
Matt C
  • 4,470
  • 5
  • 26
  • 44