I connected the library by tutorial . It seems that everything is connected, now I want to write my own method that calls native code, which in turn will then have to call functions from the library. When I want to create a method to call the native code using the "hints" of AndroidStudio, then immediately a file is created that is circled in red.

in java

static { System.loadLibrary("speex"); } private native void initEncoder(); 

in C

 #include <jni.h> JNIEXPORT void JNICALL Java_com_audiorecorderclient_MainActivity_initEncoder(JNIEnv *env, jobject instance) { // TODO } 

and when calling the initEncoder(); function initEncoder(); catching

  java.lang.UnsatisfiedLinkError: No implementation found for void com.audiorecorderclient.MainActivity.initEncoder() (tried Java_com_audiorecorderclient_MainActivity_initEncoder and Java_com_audiorecorderclient_MainActivity_initEncoder__) 

enter image description here

Android.mk

 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libspeex LOCAL_CFLAGS = -DFIXED_POINT -DUSE_KISS_FFT -DEXPORT="" -UHAVE_CONFIG_H LOCAL_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 \ ./wrapper.c include $(BUILD_SHARED_LIBRARY) 
  • It may not see the library, the gradle file contains the following lines: ndk {moduleName "speex"}? - Alexey Shtanko
  • No, I removed them, it was impossible to connect them with them, they gave out errors - Kirill Stoianov
  • @AdamLuisSean here with such a message error #error You now need to define FIXED_POINT or FLOATING_POINT - Kirill Stoianov

0