讯飞开发平台好像并没有集成sdk的教程,只有一个demo
将sdk集成到自己项目的时候发现SpeechSynthesizer对象用SpeechSynthesizer.createSynthesizer(Context, mTtsInitListener)
初始化的时候返回对象为空。经排查发现原因有可能是以下两个问题。
1.自定义Application没有引用,
<application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name="MyApp">
2.jar包没有加载成功,在Module build.gradle文件里面加上下面的代码sync一下就可以了
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}