如何制作 TextToSpeech 语言土耳其语语音

时间:2021-04-29 18:55:05

标签: android android-studio text-to-speech speech-to-text voice-recognition

我使用的是 Android Studio。代码 java.我想将 TextToSpeech 语言设为土耳其语。如何将语音设为土耳其语?

我的代码:

TextToSpeech textToSpeech ;
ImageView ımagespeech;

textToSpeech = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
            @Override
            public void onInit(int i) {
                if (i !=TextToSpeech.ERROR){
                    textToSpeech.setLanguage(new Locale("en_US"));
                    textToSpeech.setSpeechRate((float)1.0);
                }
            }
        });

        ımagespeech.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String gettext =tvtcontextt.getText().toString();
                textToSpeech.speak(gettext,TextToSpeech.QUEUE_FLUSH,null);
            }
        });


@Override
    protected void onPause() {
        if (textToSpeech != null ){
            textToSpeech.stop();
            textToSpeech.shutdown();
        }
        super.onPause();
    }

1 个答案:

答案 0 :(得分:0)

我最近发现了这个 languages。网络应用上的语音质量看起来很有希望。

试一试:)

相关问题