How to include/use latest version of Opus codec in Android NDK

怎甘沉沦 提交于 2021-01-28 06:24:40

问题


A complete novice question here. I am pretty familiar with programming in C/C++ on Linux environments. However, I have no experience whatsoever with Android environment, let alone when it comes to making an application with C for Android platforms. I need to use opus codec in my application but it is not present in the default libraries of Android NDK. How can I add it?

Some sources on internet talk about Android.mk files. I am using the most recent version of Android Studio and there is no .mk files, only Cmake files.


回答1:


According to this, it's as easy as

 implementation "com.vcpkg.ndk.support:opus:1.3.1"

There are tons of tutorials and examples of how to integrate native code in an Android app. Generally this requires a Java (or Kotlin) wrapper and some JNI code on the C side. Consider also consuming the opus codec via ffmpeg (e.g. mobile-ffmpeg library).



来源:https://stackoverflow.com/questions/65634552/how-to-include-use-latest-version-of-opus-codec-in-android-ndk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!