How to Build an eSpeak .so File for an Android Project Using CMake and NDK

Here is how you make a .so file from eSpeak to use in your Android project. To make a .so file, we will need CMake and the NDK. For that, you can use Android Studio. Open Android Studio and go to Tools, then to SDK Manager, then go to SDK Tools. You will find CMake and NDK here. Make sure you have the latest version.

After this, go to the GitHub page for eSpeak, download the files, and extract them. Open the extracted folder and create a new folder there. You can rename it anything, but I will use android-build. Now open the Command Prompt and navigate to the android-build folder. Then copy and paste the provided code. Make sure you use the correct folder location as in the code.

To find CMake, Ninja, and NDK, go to the C Drive, go to Users, then go to your username. You will need to go to AppData, but that is hidden. Go to View → Show → Hidden files. Go to Local → Android → SDK → cmake → bin, and here are the cmake and ninja executables. Copy this address and replace it in the code. Likewise, go back to the SDK folder → NDK → latest version → build → CMake, and here is the toolchain we are going to use. Copy this address and replace it in the code. Now copy the code into the Command Prompt. Make sure to copy the dots as well.

After this is done, close the Command Prompt and rerun it as an Administrator. Navigate to the android-build folder in the Command Prompt and paste the provided code. Make sure you give the correct link for CMake.

After everything is done, you can go to the SRC folder to find your .so file. You can use this for your Android project. You can directly download the file from the following GitHub link as well. By the way, if you plan to use this for your project, please check the eSpeak license information. Thank you very much.






SUBSCRIBE

SUBSCRIBE

Welcome to Hey, Let's Learn Something!

Please sign up here to receive the latest updates on our blogs, tutorials and download section :)

Thank you for subscribing :)