How to compile the Opus audio codec library for Android
The Opus audio codec library is the next generation of the Speex audio codec library. It has made great progress in terms of codec performance and quality. Opus compilation is very simple, but the official did not provide a detailed Android version Compilation Guide, find a lot of information, after many tests, summed up a set of successful methods, details are as follows: 1. ensure that android ndk is installed on your machine and the latest opus source code is downloaded. 2. android ndk contains a compiler tool chain file for multiple android system versions (api level), but does not directly provide a specific available tool chain, therefore, you need to use ndk to generate a set of compiler tool chains, provided that you must specify the specific android system version for this tool chain. Here we take api level 14 (corresponding to android 4.0) as an example, run the following command to generate a compiler tool chain for it :~ /Android-ndk-r10e/build/tools/make-standalone-toolchain.sh -- platform = android-14 -- install-dir =/tmp/my_toolchain 3. define environment variables for temporary compilation. Run the following command: export PATH =/tmp/my_toolchain/bin /: $ PATH export CC = arm-linux-androideabi-gcc export CXX = arm-linux-androideabi-g ++ 4. configure and create the Makefile of opus source code to compile the configuration file. Run the following command :. /configure -- host = arm-linux-androideabi 5. compile the opus source code and generate the library file. Use the following command: make note that the make command will automatically compile the source code and generate the library file (static library and dynamic The library file is located in a subdirectory in the directory where the opus source code is located. The subdirectory name may start with ".", so you can run the ls-a command to check it. Here we compile the for android version, so we should not execute make install again.