gpt4 book ai didi

android - Bangla 的文字转语音功能不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:56:44 26 4
gpt4 key购买 nike

孟加拉语内容的 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);
}
}

`

最佳答案

-Google 通过软件更新更新设备上的 Google TTS 版本,以支持语言环境。
请验证是否 Google TTS 版本在被测试的两个设备上相同。
根据我的信息,Google Text-to-speech 3.11.12 添加了对 Bangla 的支持以及其他各种改进。
引用:
Google TTS

-三星设备支持:
三星文字转语音引擎
Google 文字转语音引擎

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

关于android - Bangla 的文字转语音功能不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46746513/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com