2017-10-14 81 views
3

孟加拉语的TTS内容适用于我的Nexus 5x,但不是其他手机。 在其他三星手机只能说英文单词,但跳过(不说)孟加拉语单词。文本到语音的孟加拉不工作

任何人都可以获取这种类型的问题,请帮助我。

谢谢。

代码:

@Override 
    public void onInit(int i) { 
     if (i == TextToSpeech.SUCCESS) { 

     int result = mTextToSpeech.setLanguage(new Locale("bn_IN"));//https://stackoverflow.com/questions/7973023/what-is-the-list-of-supported-languages-locales-on-android 

     floatRead.setImageResource(R.drawable.ic_volume_off); 

     if (result == TextToSpeech.LANG_MISSING_DATA 
       || result == TextToSpeech.LANG_NOT_SUPPORTED) { 
      Log.i("TTS", "This Language is not supported"); 
      AppApplication.getInstance().showToast("This Language is not supported"); 
     } 
     read(mNewsDetails.title, true); 
     read(mNewsDetails.plain_text, false); 

    } else { 
     floatRead.setImageResource(R.drawable.ic_read); 
    } 
    } 

`

void read(String text, boolean flush) { 
     if (flush == true) { 
      if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) 
       mTextToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, null, null); 
      else 
       mTextToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, null); 
     } else { 
      if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) 
       mTextToSpeech.speak(text, TextToSpeech.QUEUE_ADD, null, null); 
      else 
       mTextToSpeech.speak(text, TextToSpeech.QUEUE_ADD, null); 
     } 
    } 

`

回答

3

-Google通过软件更新更新设备上的Google TTS版本,以使语言环境支持。
如果Google TTS版本在两个正在测试的设备中都相同,请进行验证。
根据我的信息,Google Text-to-speech 3.11.12增加了对Bangla的支持以及其他各种改进。
参见:
Google TTS

-Samsung设备的支持:
三星文本到语音转换引擎
谷歌文本到语音转换引擎

这实际上有不同的语言环境支持集。