亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

php調(diào)用Google translate_tts api實(shí)現(xiàn)代碼

 更新時(shí)間:2013年08月07日 10:25:01   作者:  
以下是對(duì)php調(diào)用Google translate_tts api的實(shí)現(xiàn)代碼進(jìn)行了分析介紹,需要的朋友可以過來參考下
今天用google翻譯時(shí),發(fā)現(xiàn)個(gè)好東西:Google translate_tts,調(diào)用這個(gè)api就可以聽到英文發(fā)音,
省掉了自己上傳音頻文件的麻煩。
我用php寫了個(gè)調(diào)用的方法,可以把音頻文件保存在本地。
如下:
復(fù)制代碼 代碼如下:

$newfname = '1.wmv';
$reqBaseURL = 'http://translate.google.com/translate_tts?tl=en&q=how%20do%20you%20do';
$remote_file = fopen($reqBaseURL, "rb");
if ($remote_file){
 $newf = fopen($newfname, "wb");
 if ($newf){
  while(!feof($remote_file)){
   fwrite($newf, fread($remote_file, 1024 * 8),1024 * 8);
  }
 }
}
if ($remote_file) {
 fclose($remote_file);
}
if ($newf) {
 fclose($newf);
}

相關(guān)文章

最新評(píng)論