#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    31
    Rep Power
    2

    Different Language Speech on Python for Android


    Hello community, I'm new to this site and to Python in general so please forgive my ignorance. I use Python on Android devices therefore I'm always importing the android module to take advantage of some of the OS's features. I know how to use the ttsSpeak to output English text as English speech but what I want to do make it so when I input English text it will output the speech to a language of the user's choice. The only way I could do that now is manually go into the TTS settings on the Android device and change the output language.

    There must be some command that will do this. I've been searching somewhat and not finding the answer. Thanks so much for reading this!
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    618
    Rep Power
    65
    Sounds interesting, can you show us a little of your code?
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    31
    Rep Power
    2
    Well it'd be along these lines:
    *************************************
    Import android
    Droid = android.Android()

    O = Droid.dialogGetResponse('Enter what you want Ms. Droid to say').result

    Def talk():
    Droid.ttsSpeak(O)

    Talk()
    ******************************************

    Very simple to have the Droid speak whatever you input in English text. If I could figure out the command for having it output to a different language I would incorporate a menu for language selection
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    618
    Rep Power
    65
    Thanks Guitarman!
    I assume you are using the code on your smartphone.
    How did you get Python installed on it?
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    31
    Rep Power
    2
    Originally Posted by Dietrich
    Thanks Guitarman! I assume you are using the code on your smartphone. How did you get Python installed on it?
    There is an app called SL4A that will run scripting languages and then an app called Python for Android found on the Google Play store for the actual language. The one I'm running is based on 2.6......and its on my tablet which I use more than an actual PC (not that it matters as Android is Android). There are ways to toggle WiFi, control screen brightness, BT, GPS ......pretty much many of the system settings can be toggled/controlled from a script.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    31
    Rep Power
    2
    Maybe I would have correct results if I used a website to do this?

IMN logo majestic logo threadwatch logo seochat tools logo