简体   繁体   English

TextToSpeech数据下载

[英]TextToSpeech data download

The code bellow is used for install the TTS data. 下面的代码用于安装TTS数据。

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? 此代码用于安装设备中安装的所有TTS插件的所有数据吗?
  • 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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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