// mInstaller = new ApkInstaller(SpeakService.this);
// 设置参数
setParam();
int code = mTts.startSpeaking(content, mTtsListener);
if (code != ErrorCode.SUCCESS) {
if (code == ErrorCode.ERROR_COMPONENT_NOT_INSTALLED) {
// 未安装则跳转到提示安装页面 mInstaller.install();
} else {
// 语音合成失败,错误码:code
}
}
return super.onStartCommand(intent, flags, startId);
}
@Override
public void onCreate() {
super.onCreate();
}
/**
- 初始化监听。
*/
private InitListener mTtsInitListener = new InitListener() {
@Override
public void onInit(int code) {
Log.d(TAG, "InitListener init() code = " + code);
if (code != ErrorCode.SUCCESS) {
// 初始化失败,错误码: code
} else {
// 初始化成功,之后可以调用st