private void initVoice() {
speechSynthesizer = new SpeechSynthesizer(MainActivity.this, "holder",this);
// 将setApiKey方法的两个参数替换为注册的apiKey和secretKey
speechSynthesizer.setApiKey("pppppppppppp","pppppppppppppppppppppppppppppppppppppppp");
speechSynthesizer.setAudioStreamType(AudioManager.STREAM_MUSIC);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
收藏
点赞
0
个赞
请登录后评论
TOP
切换版块
该类是单实例的,需要通过newInstance方法初始化,请仔细看下sample工程