Speex on Android
来源:互联网 发布:随身带着淘宝去异界301 编辑:程序博客网 时间:2024/05/01 19:39
Speex on Android
JSpeex does not work very well on Android, encoding times are between 0.03 to 0.2 seconds for a 320 samples frame. Way to much for any real-time app (can you say in-game voice chat? :p). So i set out to get the native speex to compile for Android. A couple of steps are involved if you don’t want to go the configure road with ndk r5b.
- Download the latest speex source distri.
- Create your project’s folder, and a jni/ folder inside that folder
- Copy the libspeex/ and include/ folders from the speex distri to your jni/ folder. You should end up with $project/jni/libspeex and $project/jni/include
- Add the following thingy as your Android.mk file in your jni/ folder
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libspeexLOCAL_CFLAGS = -DFIXED_POINT -DUSE_KISS_FFT -DEXPORT="" -UHAVE_CONFIG_HLOCAL_C_INCLUDES := $(LOCAL_PATH)/include LOCAL_SRC_FILES := \./libspeex/bits.c \./libspeex/buffer.c \./libspeex/cb_search.c \./libspeex/exc_10_16_table.c \./libspeex/exc_10_32_table.c \./libspeex/exc_20_32_table.c \./libspeex/exc_5_256_table.c \./libspeex/exc_5_64_table.c \./libspeex/exc_8_128_table.c \./libspeex/fftwrap.c \./libspeex/filterbank.c \./libspeex/filters.c \./libspeex/gain_table.c \./libspeex/gain_table_lbr.c \./libspeex/hexc_10_32_table.c \./libspeex/hexc_table.c \./libspeex/high_lsp_tables.c \./libspeex/jitter.c \./libspeex/kiss_fft.c \./libspeex/kiss_fftr.c \./libspeex/lpc.c \./libspeex/lsp.c \./libspeex/lsp_tables_nb.c \./libspeex/ltp.c \./libspeex/mdf.c \./libspeex/modes.c \./libspeex/modes_wb.c \./libspeex/nb_celp.c \./libspeex/preprocess.c \./libspeex/quant_lsp.c \./libspeex/resample.c \./libspeex/sb_celp.c \./libspeex/scal.c \./libspeex/smallft.c \./libspeex/speex.c \./libspeex/speex_callbacks.c \./libspeex/speex_header.c \./libspeex/stereo.c \./libspeex/vbr.c \./libspeex/vq.c \./libspeex/window.c include $(BUILD_SHARED_LIBRARY)
- Add the following thingy as your Application.mk file in the jni/ folder
APP_ABI := armeabi armeabi-v7a
This will compile binaries for the arm and arm-v7a cpus.
- Add the following thingy as a file called speex_config_types.h to the $project/jni/include/speex/ folder.
#ifndef __SPEEX_TYPES_H__#define __SPEEX_TYPES_H__typedef short spx_int16_t;typedef unsigned short spx_uint16_t;typedef int spx_int32_t;typedef unsigned int spx_uint32_t;#endif
- switch to the jni/ folder in your shell and type ndk-build. You’ll end up with shared libs in the libs/armeabi and libs/armeabi-v7a folder
- Write a JNI wrapper for decoding and encoding
- …
- Profit!
I zipped up my jni folder, you can download it here. Just fire up your shell, make sure your NDK is in your $PATH and ndk-build the shit out of it. Enjoy.
转贴:http://www.badlogicgames.com/wordpress/?p=1726&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+PlanetAndroidCom+%28Planet+Android%29
- SPEEX ON ANDROID
- Speex on Android
- Speex for Android
- Android中使用SPeex
- Speex for android
- speex
- speex
- speex
- Speex
- speex
- speex
- speex
- Speex
- Android Speex编译及使用
- Android移植speex部分问题解决
- Android移植Speex回声消除
- 编译Speex生成so库文件(android-speex)
- speex编解码在android上实现
- 使用HISTTIMEFORMAT 显示history命令的时间戳
- 安装smarty
- PyGTK 多线程
- 不作恶已成历史?
- webservice 测试窗体只能用于来自本地计算机的请求
- Speex on Android
- memcache linux下的使用(二)
- 如何定义Select下拉框的边框颜色和滚动条样式
- Android代码优化那些事儿
- DirectX Input 键盘实现
- 算法之分治算法
- 宏
- SIMD(MMX/SSE/AVX)变量命名规范心得
- TestLink1.9.3测试用例:Excel转换XML工具<二>实现代码