# xunfei-tts **Repository Path**: iamluodong/xunfei-tts ## Basic Information - **Project Name**: xunfei-tts - **Description**: 讯飞在线语音合成cordova插件 - **Primary Language**: Android - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2015-11-25 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #讯飞语音识别Cordova插件 此源码来源网上 收集,自用放在仓库里比较方便。所涉及包名未做更改。 http://www.tomorrowshine.com/user/article/458.html ## 安装 ``` cordova plugin add cordova-plugin-xunfei-tts ``` > 此插件已经带了讯飞的相关库,jni部分只包含armv7a的库.讯飞原始库 Android_voice_1084_53e4cc8f.zip ## ## 测试 ``` document.getElementById("speeh").addEventListener('click', function() { var speakNative = cordova.require('cordova-plugin-xunfei-tts.SpeakNative'); speakNative.init({"VOICE_NAME":"xiaoyan","PITCH":"50","SPEED":"50","VOLUME":"50","KEY_REQUEST_FOCUS":"true"},function(s){console.log(s)},function(r){console.log(r)}); var msg={}; msg.text="科大讯飞 i'm speaking"; msg.onend=function(e){ console.log(e); }; speakNative.speak(msg); }); ``` > 如果发现有时中文无法正确发声,请检查js文件的编码。 >