We have moved to a new Sailfish OS Forum. Please start new discussions there.

text-to-speech (TTS) for Android apps in Alien Dalvik? [answered]

asked 2014-01-25 20:21:06 +0300

StaticNoiseLog gravatar image

updated 2015-02-12 08:20:13 +0300

I noticed that Android apps like OsmAnd or AnyMemo do not produce the expected sound. They are supposed to read out some text (street names, words in the vocabulary...).

I made sure that this is not the same problem as described here. Sound in Android does work.

So I came to the conclusion that Alien Dalvik comes without a text-to-speech engine. I tried to install eSpeak TTS (downloaded in the browser from F-Droid, it does not appear in the F-Droid app). But eSpeak TTS refuses to "set as your default text-to-speech engine" with this error: Unsupported action That action is not currently supported

Has anybody got TTS working in Android apps? Which engine did you use, from where did you install it and how did you activate it?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by olf
close date 2017-11-04 02:12:24.130185


I don't know if this counts, but if you have Google Play services installed (The unoffficial Google Play store install thingy), it contains the Google TTS thing. At least I think it does, although the only place I have tested this is Google Voice Search

Bulder ( 2014-01-25 21:28:03 +0300 )edit

Thank you for your suggestion. I am a bit hesitant to install Google Play store because I suspect it will do things in the background I don't need. Have you got any experience with it on the Jolla? Did you realize an impact on battery life? I wrote to IVONA asking them to publish their software in the Amazon app store. Who knows...

StaticNoiseLog ( 2014-02-04 22:55:29 +0300 )edit

I tried GoogleTTS with no effect. IMHO the preferences stuff for switching tts on is missing

cy8aer ( 2014-02-24 23:32:54 +0300 )edit

@cy8aer: Thanks for trying Google's TTS. Do you mean preferences for Alien Dalvik are missing? Or just within a specific application?

StaticNoiseLog ( 2014-02-25 19:35:18 +0300 )edit

I mean the global tts preferences for selecting the tts and the voices.

cy8aer ( 2014-03-23 21:10:37 +0300 )edit

2 Answers

Sort by » oldest newest most voted

answered 2014-12-27 17:04:11 +0300

Zmirir gravatar image

updated 2015-02-11 10:41:37 +0300

Hi, I've managed to activate the TTS.

Step 1 (With Google stuff): First, I've installed the google play store following this how to: http://www.jollatides.com/2014/04/03/updated-installing-google-play-on-jolla/ . Then, I've installed google TTS using google play.

Step 1 (Alternative without Google stuff): As Fuzzillogic pointed out, you can also use any other tts engine you find in any other android app market.

Fuzzillogic: I've installed eSpeak TTS using f-droid,...

Step 2: Afterward, I've opened the terminal again and switched into root :

[nemo@Jolla ~]$ devel-su

Then, I've opened the settings.db using sqlite3:

 [root@Jolla data]# sqlite3 /data/data/com.android.providers.settings/databases/settings.db

Now, I've checked whether the tts related options are already set or not:

sqlite> Select * FROM secure WHERE name LIKE 'tts_default_synth';

If the option is not, set the result will look like this:

sqlite> Select * FROM secure WHERE name LIKE 'tts_default_synth';

Otherwise, you will get (Note that the first number (59) and the last value (com.google.android.tts) of the result might be different.):

sqlite> Select * FROM secure WHERE name LIKE 'tts_default_synth';

Step 3 (no option set): In my case, no options were set. Hence, I've inserted the necessary:

sqlite> insert into secure values (null, 'tts_default_synth', 'com.google.android.tts');

In case you installed another tts engine, you have to alter the query to use your tts. For example,

Fuzzillogic: and used "com.googlecode.eyesfree.espeak" as tts_default_synth instead.

results in

sqlite> insert into secure values (null, 'tts_default_synth', 'com.googlecode.eyesfree.espeak');

Step 3 (option set): In case, a tts engine is already set and it is not the one you would like to use, you can alter it:

sqlite> UPDATE secure SET value='com.google.android.tts' WHERE name='tts_default_synth';

Last, the alien dalvik service has to be restarted:

Step 4: systemctl restart aliendalvik.service

This did the trick for me for my sportstracker app. I could also adjust the language directly from within the app. I've not tested it for other apps. But other users pointed out, it worked for them as well.

Known Issues: In case you cannot alter the language of your tts engine directly in app you want to use, you might get stuck with the default language.

edit flag offensive delete publish link more



Aha! It does work, even without the Google Play Store-cr@p. I've installed eSpeak TTS using f-droid, and used "com.googlecode.eyesfree.espeak" as tts_default_synth instead. While it's still impossible to alter the general settings in the config app, it is possible to use it in apps. (Tested in OsmAnd~) Now to figure out how to get it to actually speak Dutch, instead of Dutch with English pronunciation...

Fuzzillogic ( 2015-02-11 00:16:20 +0300 )edit

Follow up on that: there are more parameters in the database regarding tts, but most of them are deprecated. While eSpeaks supports Android 2.2 and up, so when those parameters were still active, I've no clue whether they are still important or not. Also, something has set the accessibility_enabled back to 0 (default), and I guess it has no effect on tts anyway.

Fuzzillogic ( 2015-02-11 00:51:57 +0300 )edit

@Fuzzillogic: Thanks for the information. I've added the information for not using Google. After some tests, I also removed the accessibility_enabled, as it does not seem to have any influence.

The deprecated parameters can be used. It might work for some tts engines and apps, but for the newer ones it will not work. It really depends on both, the app integrating the tts and the tts engine itself. But if you are interested for your case, you might want to play around TTS_DEFAULT_LANG and TTS_DEFAULT_COUNTRY. It might work for your combination. Others might be also interested in your results :).

Zmirir ( 2015-02-11 10:37:58 +0300 )edit

This was the "Parameter" nowhere to be set in missing preferences editor.

cy8aer ( 2015-02-11 15:49:45 +0300 )edit

eSpreak TTS crashes on my JollaC (after applying the above settings. I guess it just crashes after applying these settings because without them it already aborted beforehand due to the "not default TTS app" error). Does anyone else also have the issues? Do you know a workaround and/or another non-google/free alternative?

bomo ( 2016-07-30 13:01:34 +0300 )edit

answered 2017-11-02 00:54:08 +0300

olf gravatar image

updated 2018-07-18 21:54:45 +0300

Yes, AlienDalvik lacks a built-in TTS engine, but that can be easily resolved by installing one.

  • The standalone Google TTS engine (com.google.android.tts, e.g. from Aptoide) is working fine and provides good quality speech.
    Note that on a Jolla 1 with its AOSP 4.1.2 based AlienDalvik (API level 16) the Google TTS engine version 3.10.9 (210310090) seems to be the latest installable one. I would expect the current version of it to be installable on all other SailfishOS devices with AlienDalvik (i.e. Jolla C, Intex Aquafish, Jolla Tablet, Xperia X), as their AlienDalvik is based on AOSP 4.4 (API level 19).

  • I also tried the IVONA TTS engine and its speech quality is absolutely astonishing: As if an experienced human reader with a pleasant voice is speaking to you. But it comes at a price: Its enormous size (plus more for the voices) and requesting access rights to your contacts and accounts.

  • In contrast to that eSpeak sounds really bad, i.e. "robotic" like speech synthesis in the early 1990s. Furthermore, "eSpeak free" from F-Droid does not work at all. The proprietary eSpeak version (e.g. from Aptoide) works, basically.
    But both eSpeak versions have severe stability issues (i.e. regularly ceasing to work and they seem to make the whole Android TTS subsystem unstable, so one has to restart AlienDalvik) and their speech quality is just too low to be really bearable.

  • Flite (from F-Droid) failed to run properly, too.

  • All other TTS engines for Android (which I have looked at) require paid TTS voice data and many of them request access rights far more extensive than the IVONA TTS.

As AlienDalvik lacks TTS settings (respectively system-wide Android settings in general), one has to install an Android app providing settings for language selection and speed & pitch of the TTS, utilised TTS engine (one can have multiple installed), plus access to the settings of the installed TTS engines:

  • "@Voice aloud reader" (com.hyperionics.avar, e.g from Aptoide) provides access to these settings (though a bit complicated, as described below) and is a nice tool allowing to read any text (files and per Android's "share" / intent mechanism) aloud.
    In order to set up the Android (AlienDalvik) TTS settings, tap on the "^" button in its overlay menu at the bottom (i.e. the rightmost one) and hit "Change Voice or Language" there: In the settings page, which is opened then, leave "Use our voice manager" selected and hit the (middle) button "Add voice / language" (at the bottom), which opens a sub-page, which allows to configure the (Android / AlienDalvik) system-wide TTS settings. The button "Add a new voice for selected engine" there opens the individual settings page of the currently selected TTS engine (thus this button label is a real misnomer): Configure it to your preferences.
    This way all installed Android TTS engines can be completely configured at the GUI.
  • "FBReader TTS+ Plugin" (com.hyperionics.fbreader.plugin.tts_plus) also provides TTS settings (in exactly the same way as "@Voice aloud reader") and integrates into FBReader (org.geometerplus.zlibrary.ui.android).
    Note that version 3.7.2 (3070202) of the "FBReader TTS+ Plugin" seems to be its last (i.e. final) release (in 2016), and the FBReader version 2.7.14 (2071403) seems to be the last one which supports the TTS+ plugin. This in turn requires all other FBReader plugins (org.geometerplus.fbreader.plugin.*) to be below version 1.7 (i.e. 1.6.4 for most of them).
    Also note that the integration of the TTS+ plugin into FBReader is a bit flaky, but once set up it runs well and the ability to have eBooks read aloud is just great IMO.

Side note: The standalone Google TTS engine can work completely offline. To achieve this, disable "Auto-update voices" and "Anonymous usage reports" in its options, which are opened by the "︙"-button in the upper right corner of its engine specific settings page (accessible as described above).
Furthermore have "Show also voices that need network connection" disabled in the top level settings of "@Voice aloud reader" / "TTS+ plugin" to prevent the use of "online voices" (i.e. your text is sent to the TTS provider and synthesised audio data is returned; some providers call this "high quality online voices").

Finally make the Android TTS engine of your choice the default TTS engine for AlienDalvik, as described by zmirir (as there is no GUI for that and this setting is usually just unset, i.e. non-existent).

  • Note that the path to the database file is different on SailfishOS devices, which do not use BTRFS for their internal filesystems (i.e. the recent ones), it is /home/.android/data/com.android.providers.settings/databases/settings.db there.
  • Also note, that @Zmirir missed to document step 3.5 (i.e. to be executed between steps 3 and 4): sqlite> .exit

Thanks to @yomark for testing this and detecting the last (missing) point.

edit flag offensive delete publish link more


Thank you for this. Unfortunately still have no TTS audio in for example OsmAnd.

So I'm in FBReader TTS+ Plugin, and there I have the choice "Use our voice manager" or "Use only the system default voice". The first one works(reads from the eBook also), the second one is does not do anything.

Also, when tapping on "System TTS settings" button(when using system default voice), I get "unsupported action".

When "Use our voice manager"(is also using google TTS, right? ) , and I tap "Add a language/voice" and then "add new voice for selected engine"(Google TTS is selected there) I get in the google TTS options, an I can download languages there.

When using "system default voice"(I figure OsmAnd is using this also?) FBReader is still silent then.

Any tips and tricks I can try?

Thank you in advance. (Using Sailfish X by the way)

yomark ( 2017-11-03 12:14:53 +0300 )edit

To answer my own question.. I think I fixed it now by using the answer by Zmirir above. It seems that installing google TTS engine(or another one like Ivona - unfortunately has no Dutch voice) does not set one by default in AlienDalvik(Sailfish X).

As the settings database was in another place, the instructions are slightly different, so:

  • make sure you enabled developer mode

  • from terminal/ssh session:

    sqlite3 /opt/alien/data/data/com.android.providers.settings/databases/settings.db

  • insert into secure values (null, 'tts_default_synth', 'com.google.android.tts');

  • .exit

  • systemctl restart aliendalvik.service

  • install FBReader and TTS+ Plugin like above

  • use it to get to the Google/Android TTS settings and configure it.

I now have TTS using "system default voice" in FBReader and TTS+ Plugin. I have yet to test OsmAnd, but I think that it also going to work now.

yomark ( 2017-11-03 12:48:59 +0300 )edit

I did all of this at the GUI (2.5 years ago on my Jolla 1 phones), but the buttons in "@Voice aloud reader" and "FBReader TTS+ plugin" are not well named. So I tried to enhance my answer above in this regard.

olf ( 2017-11-03 22:19:21 +0300 )edit

@yomark, does TTS now also work for you in OSMand?

I hope so, as I never experienced any issues with it, but had TTS in AlienDalvik configured, before I tried voice navigation with OSMand.

olf ( 2017-11-03 23:21:44 +0300 )edit

@olf yes, it does work fine now!

yomark ( 2017-11-04 00:59:20 +0300 )edit

Question tools



Asked: 2014-01-25 20:21:06 +0300

Seen: 6,325 times

Last updated: Jul 18 '18