简体   繁体   English

访问本机音频记录

[英]Accessing Native AudioRecord

I need to access the native AudioRecord class, however it is not exposed via the standard API.我需要访问本机 AudioRecord class,但它没有通过标准 API 公开。

When I attempt to compile code that includes AudioRecord.h using the NDK, it doesn't find the header files.当我尝试使用 NDK 编译包含 AudioRecord.h 的代码时,它找不到 header 文件。 How do I modify the make files to point to the lib media directories and link with libmedia.so?如何修改 make 文件以指向 lib 媒体目录并与 libmedia.so 链接? I have already downloaded and compiled the android source, I'm just having trouble navigating the android build system.我已经下载并编译了 android 源代码,我只是在导航 android 构建系统时遇到了麻烦。

Is the resulting app going to require rooting the device?生成的应用程序是否需要生根设备?

Does anyone have any examples of using the AudioRecord class in native code?有没有人有任何在本机代码中使用 AudioRecord class 的例子?

You must add directory with media/AudioRecord.h to LOCAL_C_INCLUDES in Android.mk file and add libmedia.so to LOCAL_LDLIBS.您必须将带有 media/AudioRecord.h 的目录添加到 Android.mk 文件中的 LOCAL_C_INCLUDES 并将 libmedia.so 添加到 LOCAL_LDLIBS。

You can see an example here http://code.google.com/p/andless/source/browse/trunk/jni/Android.mk你可以在这里看到一个例子http://code.google.com/p/andless/source/browse/trunk/jni/Android.mk

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

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