简体   繁体   中英

How to change text to voice engine in android from english to urdu?

I am working on project in which I need voice into urdu. So any one can tell me how I can change this voice? Thanks

public void onInit(int status) {
xy.setPitch(1);
if (status == TextToSpeech.SUCCESS)
    xy.speak("this is text to speech in engish" +
            "           ", TextToSpeech.QUEUE_ADD, null);}

It is either:

tts.setLanguage(new Locale("ur"));

Or:

tts.setLanguage(new Locale("urd"));

Used this link to find out.

there are two option to do that. 1- goto androd setting and change your language to URDU 2- tts.setLanguage(new Local("urd"));

t1=new TextToSpeech ( getApplicationContext (), new TextToSpeech.OnInitListener () { @Override public void onInit(int status) { if(status != TextToSpeech.ERROR) {

                t1.setLanguage(new Locale("ur"));
            }**strong text**

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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