见下图
请看图片..首先我按下点击说话,然后打开单选按钮并选择语言..当我选择英语时,必须转换成英语。只需我选择一种语言,然后转换为相同的蹩脚语言。有可能吗?n 怎么样?
我会等待尽快回答它的紧急情况。
谢谢
见下图
请看图片..首先我按下点击说话,然后打开单选按钮并选择语言..当我选择英语时,必须转换成英语。只需我选择一种语言,然后转换为相同的蹩脚语言。有可能吗?n 怎么样?
我会等待尽快回答它的紧急情况。
谢谢
试试这个
private TextToSpeech mTts;
protected void onActivityResult(
int requestCode, int resultCode, Intent data) {
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
mTts = new TextToSpeech(this, this);
} else {
// missing data, install it
Intent installIntent = new Intent();
installIntent.setAction(
TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installIntent);
}
}
}
//并为语言编写此代码
mTts.setLanguage(Locale.US);
mTts.isLanguageAvailable(Locale.UK))
mTts.isLanguageAvailable(Locale.FRANCE))
mTts.isLanguageAvailable(new Locale("spa", "ESP")))
//让你的文本发声
String myText1 = "Did you sleep well?";
String myText2 = "I hope so, because it's time to wake up.";
mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, null);
mTts.speak(myText2, TextToSpeech.QUEUE_ADD, null);