collection == null exception.
This is caused by the Voice features being set to null. The fix in
Android Marshmallow is to make onGetFeaturesForLanguage return an
empty HashSet object. This does not work for eSpeak because:
1. eSpeak was overriding onGetVoices and initializing each Voice's
features to null;
2. the bug is still present on Lollipop.
Thus, the fix here is two-fold:
1. make onGetVoices use onGetFeaturesForLanguage;
2. make onGetFeaturesForLanguage return an empty HashSet, so that
eSpeak does not crash on Lollipop either.
eSpeak Text-to-Speech for Android™
This branch contains the files needed to build espeak on the android platform. It is derived from the eyes-free project.
Build Dependencies
In order to build eSpeak, you need:
- a functional autotools system (
make,autoconf,automake,libtoolandpkg-config); - a functional c++ compiler;
- wxWidgets development libraries (needed to build and run espeakedit to compile the phoneme data).
In order to build the APK, you need:
- the Android SDK with API 21 support;
- the Android NDK;
- Gradle 2.1.
In order to use Android Studio, you will also need:
Debian
| Dependency | Install |
|---|---|
| autotools | sudo apt-get install make autoconf automake libtool pkg-config |
| c++ compiler | sudo apt-get install gcc g++ |
| wxWidgets | sudo apt-get install libwxgtk2.8-dev |
| gradle | gradle-2.1_0ubuntu1_all.deb |
Building
Building with Gradle
-
Set the location of the Android SDK:
$ export ANDROID_HOME=<path-to-the-android-sdk> -
Build the project:
$ ./autogen.sh $ ./configure --with-gradle=<path-to-gradle> $ make
This will create an android/build/outputs/apk/espeak-release-unsigned.apk file.
Signing the APK
In order to install the built APK you need to self-sign the package. You can do this by:
-
Creating a certificate, if you do not already have one:
$ keytool -genkey -keystore [YOUR_CERTIFICATE] -alias [ALIAS] -
Sign the package using your certificate:
$ jarsigner -sigalg MD5withRSA -digestalg SHA1 \ -keystore [YOUR_CERTIFICATE] \ android/build/outputs/apk/espeak-release-unsigned.apk [ALIAS] -
Align the apk using the zipalign tool.
$ zipalign 4 android/build/outputs/apk/espeak-release-unsigned.apk \ android/build/outputs/apk/espeak-release-signed.apk
Installing
Now, you can install the APK using the adb tool:
$ adb install -r android/build/outputs/apk/espeak-release-signed.apk
After running, eSpeakActivity will extract the espeakdata.zip file into its
own data directory to set up the available voices.
To enable eSpeak, you need to:
- go into the Android
Text-to-Speech settingsUI; - enable
eSpeak TTSin theEnginessection; - select
eSpeak TTSas the default engine; - use the
Listen to an exampleoption to check if everything is working.
Bugs
Report bugs to the espeak issues page on GitHub.
License Information
eSpeak Text-to-Speech is released under the GPL version 3 or later license.
The eSpeak Android APK code in the android folder is released under the
Apache 2.0 license.
Android and Google Play are registered trademarks of Google Inc.
All trademarks are property of their respective owners.

