为什么谷歌tts印地语(代码)不起作用?

时间:2017-01-17 14:57:09

标签: android text-to-speech

此代码对英语运行良好。但是,不要为印地语工作。请你帮助我好吗?感谢..

private void speach_text() {

                if (textview2.toString().equals("1")) {
                    loc1 = "en";
                    loc2 = "en_EN";
                }

                if (textview2.toString().equals("2")) {
                    loc1 = "hi";
                    loc2 = "hi_IN";
                }                

        final Locale locale = new Locale(lo1, lo2);

        tts = new TextToSpeech(Mainactivity.this, new TextToSpeech.OnInitListener() {

            @Override
            public void onInit(int status) {
                if (status == TextToSpeech.SUCCESS) {
                    int result = tts.setLanguage(locale);
                    tts.speak(textview1.getText().toString(),TextToSpeech.QUEUE_FLUSH, null);
                } else {               
                }
            }
        });
    }

0 个答案:

没有答案