如何在 Android NDK 中包含/使用最新版本的 Opus 编解码器 [英] How to include/use latest version of Opus codec in Android NDK

查看:45
本文介绍了如何在 Android NDK 中包含/使用最新版本的 Opus 编解码器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有一个完整的新手问题.我非常熟悉 Linux 环境中的 C/C++ 编程.但是,我对Android环境没有任何经验,更不用说用C为Android平台制作应用程序了.我需要在我的应用程序中使用 opus 编解码器,但它不存在于 Android NDK 的默认库中.如何添加?

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?

互联网上的一些资源讨论了 Android.mk 文件.我使用的是最新版本的 Android Studio,没有 .mk 文件,只有 Cmake 文件.

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.

推荐答案

根据 这个,就这么简单

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

有大量关于如何在 Android 应用中集成本机代码的教程和示例.通常,这需要 Java(或 Kotlin)包装器和 C 端的一些 JNI 代码.还可以考虑通过 ffmpeg 使用 opus 编解码器(例如 mobile-ffmpeg 库).

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).

这篇关于如何在 Android NDK 中包含/使用最新版本的 Opus 编解码器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆