Speech 2 Text 2 Speech

Hot off the heels of my previous post on getting Python scripting on my Android phone via the “Scripting Layer For Android“, I wrote my first (silly) Python module directly on the phone:  I’ve coined it ‘Speech 2 Text 2 Speech‘:  You speak into the phone, it converts it to text, then says it back.  And, it’s sooo easy to do:

# speech2text2speech.py
import android
droid = android.Android()
speech = droid.recognizeSpeech("Talk Now", None, None)
print speech[1]
droid.ttsSpeak(speech[1])

Sometimes the “Talk Now” window pops up too fast and you have to reset it, but when it works it’s pretty funny to hear what you said repeated back in ‘Androidish’ 😉

Android Adventures
Android Adventures, part 2
  • Trackback are closed
  • Comments (2)
    • Trace
    • October 19th, 2011 1:39am

    This is way to cool. The possibilities are endless. So simple, it’s one of those “Why didn’t I think of that!”.
    Great job!

    • debra walters
    • April 15th, 2016 7:16am

    I would also recommend iSpeech API, they have SDK for python too and their natural sounding voices give a higher quality TTS.

    Check here.. http://www.ispeech.org/

Comment are closed.