private function test():void { var request:URLRequest = new URLRequest(); var str:String = "从前有座山,山上有座庙,庙里有个老和尚"; var url:String = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=" + str; // baidu url = "http://translate.google.cn/translate_tts?ie=UTF-8&tl=zh-CN&total=1&idx=0&textlen=19&prev=input&q=" + str; // google request.url = encodeURI(url); request.contentType = "audio/mp3"; // for baidu request.contentType = "audio/mpeg"; // for google var sound:Sound = new Sound(request); sound.play(); }
详细解决方案
使用百度或谷歌服务将文字转话音
热度:155 发布时间:2013-10-01 12:15:56.0
相关解决方案