指路: Native.js - ios - plusSetAttribute
希望官方能够写篇Native.js通俗教程
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>iOS Native.js</title>
<script type="text/javascript">
// 监听plusready事件
document.addEventListener( "plusready", function(){
// 扩展API加载完毕,现在可以正常调用扩展API
// 调用ios的文字转语音
var AVAudioSession = plus.ios.importClass("AVAudioSession");
var AVSpeechSynthesizer = plus.ios.importClass("AVSpeechSynthesizer");
var sppech = new AVSpeechSynthesizer();
var AVSpeechUtterance = plus.ios.importClass("AVSpeechUtterance");
AVAudioSession.sharedInstance().setCategoryerror("AVAudioSessionCategoryPlayback",null);
var utterance = AVSpeechUtterance.speechUtteranceWithString("共产主义接班人");
// 设置语速
utterance.plusSetAttribute("rate",0.3); // <-- 这句话没有效果!!!!!!
sppech.speakUtterance(utterance);
}, false );
</script>
</head>
<body>
</body>
</html>
eachann (作者)
标题有写
https://www.html5plus.org/doc/zh_cn/ios.html
ios - plusSetAttribute
2019-09-16 14:50