How to compile the Opus audio codec library for Android

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.