简体   繁体   中英

TextToSpeech data download

The code bellow is used for install the TTS data.

Intent installIntent = new Intent();
installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installIntent);

Some questions:

  • This code is used for install all data for all TTS plugins installed in the device?
  • This code is used for install data for all languages? How can I specify the language for data download?

You can specify the language as follow

Intent installIntent = new Intent();
installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);    
ArrayList<String> languages = new ArrayList<String>();
languages.add("it-IT"); // for example this will install Italian language
installIntent.putStringArrayListExtra(TextToSpeech.Engine.EXTRA_CHECK_VOICE_DATA_FOR, 
                                                languages);
startActivity(installIntent);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM