代码拉取完成,页面将自动刷新
##---------------------简介---------------------
##使用方便,统一管理
#1、在 Application oncreate 方法里初始化
XfSpeechAgent mXfSpeechAgent = XfSpeechAgent.getInstance();
mXfSpeechAgent.init(context,"appId"); //appId 为在讯飞 平台申请的 appid
mXfSpeechAgent.setDebug(true); //打开 debug log
#2、在掉用的 地方(Activity) 初始化 语音合成引擎
mXfSpeechAgent = XfSpeechAgent.getInstance();
if (!mXfSpeechAgent.isInitSpeechEngine()) {
mXfSpeechAgent.initSpeechEngine(MainActivity.this);
}
#3、在需要的地方 调用语音合成 (播音)
mXfSpeechAgent.setVoicer(Voicer.XIAOXIN); // 设置播音员(可选)
mXfSpeechAgent.speak("测试语音合成,请多多支持!");
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。