简体   繁体   中英

Python SL4A in other Language than English

I am trying to write a small script which can speak in my own language.

import sl4a SpeakMe = sl4a.Android() mesaj = SpeakMe.dialogGetInput('What would you want me to say ?') SpeakMe.ttsSpeak(mesaj)

when I run this code in my android it opens a dialog and let me enter a text so it can read it ; but i want it to read in my language cause it tries to read in English and it is very funny and wierd voicing.

is it possible to call tts to speak in any other language than English ?

You can do that, but you need go to mobile configuration choose language and input text, and text to speech, here choose the language you need your mobile speak. Finally write in you python script the following text:

import android
droid = android.Android()
#write Hello in chinese
str = "你好"
droid.ttsSpeak(str)

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