Is there any intention for a READ_ALOUD action in the GDK?

I would like to read some text for the user as possible in the Mirror API. Is this possible in Google Glass GDK via Intent?

+6
source share
1 answer

This is not an intention, but for this purpose you can use the TextToSpeech class for Android. Essentially, just create an instance of TextToSpeech , and then call the speak method with the string you want it to say.

There are some initialization overheads associated with the TTS engine, so you should try to do this sooner; You may experience a delay if you try to initialize the engine the moment you want it to speak.

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

+7
source

Source: https://habr.com/ru/post/958456/


All Articles