首页 > 编程知识 正文

snoop dogg the next episode中文,do you hear the people song中文

时间:2023-05-03 16:04:44 阅读:265700 作者:2644

if(parseInt(ver) >= 8){ //判断安卓版本,大于8以上的走百度语音合成

var timestamp = Date.parse(new Date());

if(!plus.storage.getItem("oneTime")){

getBaiDuToken(msg.content); //获取百度token

plus.storage.setItem("oneTime",JSON.stringify(timestamp));

}else{

var oneTime = plus.storage.getItem("oneTime");

if((parseInt(timestamp)-parseInt(oneTime)) > 24*60*60){ //因为token24小时后过期,重新获取一次

console.log("大于24小时");

plus.storage.setItem("oneTime",JSON.stringify(timestamp)); //大于24小时就更新,再次获取token

getBaiDuToken(msg.content); //获取百度token

}else{

//小于24小时无需重新获取百度token

console.log("小于24小时");

baiduAubio(msg.content);

}

}

}else{//讯飞语音合成

var main = plus.android.runtimeMainActivity();

var SpeechUtility = plus.android.importClass('com.iflytek.cloud.SpeechUtility');

SpeechUtility.createUtility(main, "appid=你的ID");

var SynthesizerPlayer = plus.android.importClass('com.iflytek.cloud.SpeechSynthesizer');

var play = SynthesizerPlayer.createSynthesizer(main, null);

play.startSpeaking(msg.content, null);

}

大神给出的解决方案 因为平台的原因 改用百度及讯飞混用的方案

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。