资源简介
【实例简介】基于speex的回声消除,jni版本
【核心代码】
jni
├── Android.mk
├── Application.mk
├── build.xml
├── include
│ ├── Makefile.am
│ ├── Makefile.in
│ └── speex
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── speex.h
│ ├── speex_bits.h
│ ├── speex_buffer.h
│ ├── speex_callbacks.h
│ ├── speex_config_types.h
│ ├── speex_config_types.h.in
│ ├── speex_echo.h
│ ├── speex_header.h
│ ├── speex_jitter.h
│ ├── speex_preprocess.h
│ ├── speex_resampler.h
│ ├── speex_stereo.h
│ └── speex_types.h
├── libspeex
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── _kiss_fft_guts.h
│ ├── arch.h
│ ├── bits.c
│ ├── buffer.c
│ ├── cb_search.c
│ ├── cb_search.h
│ ├── cb_search_arm4.h
│ ├── cb_search_bfin.h
│ ├── cb_search_sse.h
│ ├── echo_diagnostic.m
│ ├── exc_10_16_table.c
│ ├── exc_10_32_table.c
│ ├── exc_20_32_table.c
│ ├── exc_5_256_table.c
│ ├── exc_5_64_table.c
│ ├── exc_8_128_table.c
│ ├── fftwrap.c
│ ├── fftwrap.h
│ ├── filterbank.c
│ ├── filterbank.h
│ ├── filters.c
│ ├── filters.h
│ ├── filters_arm4.h
│ ├── filters_bfin.h
│ ├── filters_sse.h
│ ├── fixed_arm4.h
│ ├── fixed_arm5e.h
│ ├── fixed_bfin.h
│ ├── fixed_debug.h
│ ├── fixed_generic.h
│ ├── gain_table.c
│ ├── gain_table_lbr.c
│ ├── hexc_10_32_table.c
│ ├── hexc_table.c
│ ├── high_lsp_tables.c
│ ├── jitter.c
│ ├── kiss_fft.c
│ ├── kiss_fft.h
│ ├── kiss_fftr.c
│ ├── kiss_fftr.h
│ ├── lpc.c
│ ├── lpc.h
│ ├── lpc_bfin.h
│ ├── lsp.c
│ ├── lsp.h
│ ├── lsp_bfin.h
│ ├── lsp_tables_nb.c
│ ├── ltp.c
│ ├── ltp.h
│ ├── ltp_arm4.h
│ ├── ltp_bfin.h
│ ├── ltp_sse.h
│ ├── math_approx.h
│ ├── mdf.c
│ ├── misc_bfin.h
│ ├── modes.c
│ ├── modes.h
│ ├── modes_wb.c
│ ├── nb_celp.c
│ ├── nb_celp.h
│ ├── os_support.h
│ ├── preprocess.c
│ ├── pseudofloat.h
│ ├── quant_lsp.c
│ ├── quant_lsp.h
│ ├── quant_lsp_bfin.h
│ ├── resample.c
│ ├── resample_sse.h
│ ├── sb_celp.c
│ ├── sb_celp.h
│ ├── scal.c
│ ├── smallft.c
│ ├── smallft.h
│ ├── speex.c
│ ├── speex_callbacks.c
│ ├── speex_header.c
│ ├── stack_alloc.h
│ ├── stereo.c
│ ├── testdenoise.c
│ ├── testecho.c
│ ├── testenc.c
│ ├── testenc_uwb.c
│ ├── testenc_wb.c
│ ├── testjitter.c
│ ├── vbr.c
│ ├── vbr.h
│ ├── vorbis_psy.h
│ ├── vq.c
│ ├── vq.h
│ ├── vq_arm4.h
│ ├── vq_bfin.h
│ ├── vq_sse.h
│ └── window.c
├── speex_echo.cpp
└── speex_jni.cpp
3 directories, 117 files
代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#define TAG “0000000000ITLMSCLIENT_NATIVE_MODULE0000000000“
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE TAG __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFOTAG__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERRORTAG__VA_ARGS__)
pthread_mutex_t mutex=PTHREAD_MUTEX_INITIALIZER;
SpeexEchoState *st;
SpeexPreprocessState *den;
static void lock()
{
pthread_mutex_lock(&mutex);
}
static void unlock()
{
pthread_mutex_unlock(&mutex);
}
extern “C“
JNIEXPORT jint JNICALL Java_com_gengj_echo_EchoCancel_open(JNIEnv *env jobject obj jint sample_rate jint frame_size jint filter_length)
{
int frameSize;
st = speex_echo_state_init(frame_size filter_length);
den = speex_preprocess_state_init(frame_size sample_rate);
speex_echo_ctl(st SPEEX_ECHO_SET_SAMPLING_RATE &sample_rate);
speex_preprocess_ctl(den SPEEX_PREPROCESS_SET_ECHO_STATE st);
speex_echo_ctl(st SPEEX_ECHO_GET_frame_SIZE &frameSize);
return frameSize;
}
extern “C“
JNIEXPORT void JNICALL Java_com_gengj_echo_EchoCancel_close(JNIEnv *env jobject obj)
{
speex_echo_state_destroy(st);
speex_preprocess_state_destroy(den);
}
extern “C“
JNIEXPORT void JNICALL Java_com_gengj_echo_EchoCancel_playback(JNIEnv *env jobject obj jshortArray input_frame)
{
jshort* native_input_frame = env-> GetShortArrayElements(input_frame NULL);
lock();
speex_echo_playback(st (spx_int16_t *)native_input_frame);
unlock();
env->ReleaseShortArrayElements(input_framenative_input_frame 0);
}
extern “C“
JNIEXPORT void JNICALL Java_com_gengj_echo_EchoCancel_capture(JNIEnv *env jobject obj jshortArray input_frame jshortArray output_frame)
{
jshort* native_input_frame = env->GetShortArrayElements(input_frame NULL);
jshort* native_output_frame = env->GetShortArrayElements(output_frame NULL);
lock();
speex_echo_capture(st (spx_int16_t *)native_input_frame (spx_int16_t *)native_output_frame);
unlock();
env->ReleaseShortArrayElements(input_frame native_input_frame 0);
env->ReleaseShortArrayElements(output_frame native_output_frame0);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1469 2015-08-31 22:56 jni\Android.mk
文件 30 2011-04-03 15:40 jni\Application.mk
文件 2867 2011-04-06 02:52 jni\build.xm
文件 17 2007-06-23 12:18 jni\include\Makefile.am
文件 14372 2008-07-21 10:17 jni\include\Makefile.in
文件 358 2008-04-25 19:21 jni\include\speex\Makefile.am
文件 13456 2008-07-21 10:17 jni\include\speex\Makefile.in
文件 13947 2008-04-25 19:21 jni\include\speex\speex.h
文件 6669 2007-08-11 21:00 jni\include\speex\speex_bits.h
文件 2172 2008-04-25 19:21 jni\include\speex\speex_buffer.h
文件 5045 2007-10-25 21:59 jni\include\speex\speex_callbacks.h
文件 225 2011-04-08 22:30 jni\include\speex\speex_config_types.h
文件 241 2007-06-23 12:18 jni\include\speex\speex_config_types.h.in
文件 6453 2008-06-05 17:27 jni\include\speex\speex_echo.h
文件 4103 2008-04-25 19:21 jni\include\speex\speex_header.h
文件 7219 2008-04-25 19:21 jni\include\speex\speex_jitter.h
文件 8609 2008-05-30 15:34 jni\include\speex\speex_preprocess.h
文件 14713 2008-05-05 20:41 jni\include\speex\speex_resampler.h
文件 3698 2008-04-25 19:21 jni\include\speex\speex_stereo.h
文件 3591 2008-04-25 19:21 jni\include\speex\speex_types.h
文件 7010 2008-05-30 15:34 jni\libspeex\arch.h
文件 10175 2008-05-30 15:34 jni\libspeex\bits.c
文件 4769 2008-05-30 15:34 jni\libspeex\buffer.c
文件 17984 2008-04-25 19:21 jni\libspeex\cb_search.c
文件 3569 2008-04-25 19:21 jni\libspeex\cb_search.h
文件 5020 2007-06-23 12:18 jni\libspeex\cb_search_arm4.h
文件 4054 2007-06-23 12:18 jni\libspeex\cb_search_bfin.h
文件 3120 2007-06-23 12:18 jni\libspeex\cb_search_sse.h
文件 2076 2007-08-11 21:00 jni\libspeex\echo_diagnostic.m
文件 2167 2007-06-23 12:18 jni\libspeex\exc_10_16_table.c
............此处省略94个文件信息
- 上一篇:STM32三菱PLC源码原理图
- 下一篇:stm32f103 can驱动
评论
共有 条评论