简体   繁体   English

android在NDK / SDK中是否有本地amr编码库?

[英]Does android has a native amr encoding library in NDK/SDK?

I've come across some 3rd party libraries like opencore-amr and others which allows for raw PCM data to be directly encoded into amr as byte arrays. 我遇到了一些第三方库,例如opencore-amr和其他一些库,这些库允许将原始PCM数据直接作为字节数组编码为amr。 However these are all software encoders written in C/C++ and borrows from many sources. 但是,这些都是使用C / C ++编写的软件编码器,并且是从许多来源中借来的。

Is there a official Amr library for android bundled in NDK or SDK where you can convert PCM to amr byte by byte? 是否在NDK或SDK中捆绑了适用于Android的官方 Amr库,您可以在其中将PCM逐字节转换为amr?

There is such a component within the system, that you can access via the MediaCodec API. 系统中有这样一个组件,您可以通过MediaCodec API进行访问。 You can access it via Java since Android 4.1 (which you need to call via JNI if you want to use it in native code) or directly as native API since Android 5.0. 从Android 4.1开始,您可以通过Java访问它(如果要在本机代码中使用它,则需要通过JNI进行调用),而从Android 5.0起,可以直接作为本机API访问。 This internally basically is the same code as opencore-amr, but wrapped up as a generic decoder/encoder component. 在内部,此代码基本上与opencore-amr相同,但被包装为通用解码器/编码器组件。

是的, MediaCodec支持 AMR-NB和AMR-WB

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM