Is there an Intent for READ_ALOUD action in GDK?
Asked Answered
S

1

6

I would like to read some text to the user, just like it's possible in Mirror API. Is that possible in Google Glass GDK via Intent?

Solfeggio answered 20/11, 2013 at 8:49 Comment(0)
H
7

It's not an intent, but you can use the Android TextToSpeech class for this purpose. Essentially, just create an instance of TextToSpeech and then call the speak method with the string you want it to speak.

There is some initialization overhead involved with the TTS engine so you should try to do it early — you may experience a delay if you try to initialize the engine at the exact moment that you want it to speak.

The CompassService class in the GDK Compass sample shows this in more detail.

Hierodule answered 20/11, 2013 at 14:56 Comment(1)
Here's a link to the CompassService class if anyone is interested: github.com/googleglass/gdk-compass-sample/blob/master/src/com/…Apocrypha

© 2022 - 2024 — McMap. All rights reserved.