Created
July 25, 2010 06:45
-
-
Save tana/489373 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
コンパイル方法: | |
haxe -main SoundPlayer -swf9 soundplayer.swf | |
注意: | |
ローカルで動かす時は、Flashの「グローバルセキュリティ設定パネル」で、soundplayer.swfがあるディレクトリを常に信頼するようにしておく。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flash.media.Sound; | |
import flash.media.SoundChannel; | |
import flash.media.SoundTransform; | |
import flash.net.URLRequest; | |
import flash.text.TextField; | |
class SoundPlayer { | |
static function main() { | |
var text = "Hello"; | |
var url = "http://translate.google.com/translate_tts?tl=en&q=" + StringTools.urlEncode(text); | |
var snd = new Sound(new URLRequest(url)); | |
var channel = snd.play(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment