# Google Text to Speech Cross Domain Problems

**URL:** <https://forum.kirupa.com/t/google-text-to-speech-cross-domain-problems/328218>\
**Category:** flash\
**Created:** [April 28, 2012, 4:47pm UTC](https://forum.kirupa.com/t/google-text-to-speech-cross-domain-problems/328218 "2012-04-28T16:47:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gemixin](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@Gemixin](https://forum.kirupa.com/u/Gemixin)\
**Post date:** [April 28, 2012, 4:47pm UTC](https://forum.kirupa.com/t/google-text-to-speech-cross-domain-problems/328218/1 "2012-04-28T16:47:55Z")

</div>

Hi there

I am successfully using this code when running my Flash file locally to play a sound file of TTS converted text:

```auto
var theSound;

function tts(textToSpeak)
{    
    theSound = new Sound(new URLRequest("http://translate.google.com/translate_tts?q=" + textToSpeak)).play();
}

function stopSpeech()
{
    theSound.stop();
}

```

And then implementing it via:

```auto
tts("Welcome to the interview. Let's begin.");

```

And stopSpeech() to stop it.

This works brilliantly until I upload the SWF to my web site and run the file there. It won’t work because of cross domain issues. (However it is interesting to note that it does work on Firefox…but not Chrome, Safari or IE). I have tried many solutions including loading a cross domain policy file with a SoundLoader context and using a PHP proxy (based on [http://blog.onebyonedesign.com/actionscript/googles-text-to-speech-engine-in-flash/](http://blog.onebyonedesign.com/actionscript/googles-text-to-speech-engine-in-flash/)) but nothing works! Has anyone got any ideas on getting this TTS streaming to work on Chrome, IE and Safari?

Thanks  
Gemma
