private String voicer = “xiaoyan”; // 默认发音人
private String[] cloudVoicersEntries;
private String[] cloudVoicersValue;
private int mPercentForBuffering = 0; // 缓冲进度
private int mPercentForPlaying = 0; // 播放进度
private RadioGroup mRadioGroup; // 云端/本地单选按钮
private String mEngineType = SpeechConstant.TYPE_CLOUD; // 引擎类型
// 语音+安装助手类
ApkInstaller mInstaller;
private Toast mToast;
private SharedPreferences mSharedPreferences;
private String content = “你好”;
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Bundle extras = intent.getExtras();
if (extras != null) {
content = extras.getString(“content”);
}
// 初始化合成对象
mTts = SpeechSynthesizer.createSynthesizer(this, mTtsInitListener);
mSharedPreferences = getSharedPreferences(TtsSettings.PREFER_NAME,
MODE_PRIVATE);
mToast = Toast.makeText(this, “”, Toast.LENGTH_SHORT);
// mInstaller = new ApkInstaller(SpeakService.this);
// 设置参数
setParam();
int cod