FIXME: Google TTS
forked from Nectarine (demoscene radio) (diff: 16)
ActionScript3 source code
/**
* Copyright makc3d ( http://wonderfl.net/user/makc3d )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/ba1I
*/
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="465" height="465">
<mx:Script>
<![CDATA[
import flash.media.Sound;
import flash.net.URLRequest;
public function play ():void {
var url:String = "http://translate.google.com/translate_tts?q=\"" +
escape (txt.text) + "\"";
// why doesn't it work?
(new Sound (new URLRequest (url))).play ();
}
]]>
</mx:Script>
<mx:TextInput id="txt" x="10" y="10"/>
<mx:Button x="180" y="11" label="Say it!" click="play ()"/>
</mx:Application>