title: Google translate Text-to-speech action canceled
body: <p>I have write a function who gets the audio element from Google Translate:</p>
  
  <pre><code>Interface.prototype.say = function( text ) {
      var audio = new Audio();
      audio.src ='http://translate.google.com/translate_tts?ie=utf-8&amp;tl=fr&amp;q=' + escape( text );
      audio.play();
  
      console.log( audio.src );
  }
  </code></pre>
  
  <p><code>audio.src</code> returns the right string to translate but It didn't say anything. In console, in Network section I found that:</p>
  
  <pre><code>translate_tts?ie=utf-8&amp;tl=fr&amp;q=Initialisation%20termine
  translate.google.com
  GET
  (canceled)
  Pending
  game.php:1
  Parser
  </code></pre>
  
  <p>As you can see, the file request was canceled. If I click on the link (first line), it works very well. It seems that it's not working only when I try to request the file to another domain, but it works perfectly in the Google Translate domain.</p>
  
  <p>What is the problem?</p>
  
  <hr>
  
  <p>Solution:</p>
  
  <pre><code>Interface.prototype.say = function( text ) {
      var section, frame;
  
      section   = document.getElementsByTagName( "head" )[ 0 ];
      frame     = document.createElement( "iframe" );
      frame.src = 'http://translate.google.com/translate_tts?ie=utf-8&amp;tl=fr&amp;q=' + escape( text );
  
      section.appendChild( frame );
  }
  </code></pre>