1

I am currently using a Pixel 4 API 30 as an avd in android studio.

I want to activate text to speech in the virtual device's settings, but there does not seem to be a direct way to do this. How can I activate it?

Here's a photo of the settings menu. As you can see, although you can test the text to speech output, I haven't found a way to use it.

enter image description here

enter image description here

TheObands
  • 378
  • 1
  • 3
  • 16
  • What does mean by activating? It is already there. In the accessibility settings, you can choose your preferred engine, language, speech rate, and pitch. And to test it you can add support for TTS using android.speech.tts.TextToSpeech in your app. More detail here: https://developer.android.com/reference/android/speech/tts/TextToSpeech – Akki Aug 01 '21 at 18:10

1 Answers1

1

Text to speech is different to Talkback. There is a question on this here

Text to speech is a voice synthesis tool that can be used by apps to convert text to speech. One of the Google provided apps called TalkBack uses this as a screen reader for those who may find it difficult to read or see the screen.

I think what you want to activate is TalkBack as a screen reader - this means if you wanted to do it via the emulator you would have to install TalkBack on your emulator. The answers here may be able to help you, either by downloading the APK from the store or by just opening Google Play from the emulator and installing it. I recommend you go through the tutorial before diving in, as TalkBack uses gestures to navigate. You might not have success as swipes tend to have "levels" (a programmatic adb swipe is different from a swipe with a finger physically on the screen for some odd reason) when it comes to accessibility.

I have found it much easier to test accessibility on real devices, as adb controls are limited. I am trying to improve the situation with my code, but it's slow going and TalkBack is far from perfect.

Update 1 Jun 2023

  1. Google API's are required for any speech synthesis on Android devices. Please check your emulator has Google API's - this is not a guarantee it will work though.
  2. I have released a developer and QA tool called the Android Ally - it allows developers to install and use TalkBack on devices and emulators without having to use the gestures or download it from the Play Store.
Quintin Balsdon
  • 5,484
  • 10
  • 54
  • 95