赞
踩
以语音合成方法为例,我在自己的应用程序中需要调用它的合成函数,所以在自己的类里调用了它的synthetizeInSilence()方法。如下
- /**
- * 使用SpeechSynthesizer合成语音,不弹出合成Dialog.
- * @param
- */
- private void synthetizeInSilence() {
- if (null == mSpeechSynthesizer) {
- //创建合成对象.
- mSpeechSynthesizer = SpeechSynthesizer.createSynthesizer(this);
- }
- //设置合成发音人.
- String role = mSharedPreferences.getString(
- getString(R.string.preference_key_tts_role),
- getString(R.string.preference_default_tts_role));
-
- //设置发音人
- mSpeechSynthesizer.setParameter(SpeechConstant.VOICE_NAME, ro

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。