我需要将用户文本的语音样式更改为语音 tts 引擎下面是我的代码
private TextToSpeech tts;
tts = new TextToSpeech(context, new TextToSpeech.OnInitListener() {
Voice voiceobj = new Voice("This is kirti for welcome you", Locale.getDefault(), 1, 1, false,
"This is");
tts.setVoice(tts.getVoice());
}
我正在使用 android Voice 类作为它添加到 API 级别 21 http://developer.android.com/reference/android/speech/tts/Voice.html
对于 Setvoice () http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#setVoice(android.speech.tts.Voice)