Posted by: developer | February 23, 2010

speex and Android.mk

Share my Android.mk for speex.

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := libspeex
LOCAL_CFLAGS = -DFIXED_POINT -DEXPORT=”” -UHAVE_CONFIG_H -I$(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/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/testdenoise.c \
./libspeex/testecho.c \
./libspeex/testenc.c \
./libspeex/testenc_uwb.c \
./libspeex/testenc_wb.c \
./libspeex/testjitter.c \
./libspeex/vbr.c \
./libspeex/vq.c \
./libspeex/window.c

#LOCAL_LDLIBS := -llog
include $(BUILD_STATIC_LIBRARY)

About these ads

Responses

  1. Hi please can you help me. How i can use speex in android? I need stream voice and use speex for this and send it on server. How i can use this mk?

    THX
    Petr Vytlacil

  2. Can you tell me where to put the speex files?
    thx

    • Which files?
      My file structure is like this:
      (1) Downloaded speex source code is in my $android-ndk/sources/speex-1.2rc; there is a Android.mk file in there.
      (2) I have $android-ndk/apps/speex-1.2rc dir; and Application.mk file in there.
      (3) Once I build my speex-1.2rc, there is a libspeex.a in my $android-ndk/out/apps/speex-1.2rc/android-1.5-arms dir.
      (4) Done. I can write JNI code to link against this libspeex.a file.

      • i do it on your said ,but it doesn’t work,could you tell me detail ,my ndk vision is r5

        Could you please describe the process to help me compile it,it takes me two days,but…

  3. i do it on your said ,but it doesn’t work,could you tell me detail ,my ndk vision is r5

  4. I know it ,thx

  5. [...] speex and Android.mk « Coding (tags: android speex speech ndk) [...]

  6. Hi, i have problem with compiling my speex, my Android.mk looks like this:
    LOCAL_PATH := $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_MODULE := libOgg
    LOCAL_CFLAGS = -DFIXED_POINT -DUSE_KISS_FFT -DEXPORT=”” -UHAVE_CONFIG_H
    LOCAL_C_INCLUDES := $(LOCAL_PATH)/ogg/include
    LOCAL_SRC_FILES := \
    ./ogg/src/bitwise.c \
    ./ogg/src/framing.c
    include $(BUILD_STATIC_LIBRARY)
    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
    include $(BUILD_STATIC_LIBRARY)
    include $(CLEAR_VARS)
    LOCAL_MODULE := spoorle_SpeexLib
    LOCAL_STATIC_LIBRARIES := libOgg libSpeex
    LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
    LOCAL_CFLAGS = -DFIXED_POINT -DEXPORT=”” -UHAVE_CONFIG_H
    LOCAL_SRC_FILES := spoorle_SpeexLib.cpp \
    speex_codec.c \
    wav_io.c
    include $(BUILD_SHARED_LIBRARY)
    when, i try compile in cygwin shows me error:
    StaticLibrary : libSpeex.a
    StaticLibrary : libstdc++.a
    SharedLibrary : libspoorle_SpeexLib.so
    C:/android-ndk-r5c/apps/SpoorleClient/obj/local/armeabi/objs-debug/spoorle_Speex
    Lib/spoorle_SpeexLib.o: In function `speexenc(char const*, char const*)’:
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:216: undefined reference
    to `read_wav_header(__sFILE*, int*, int*, int*, int*)’
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:392: undefined reference
    to `flush_ogg_stream_to_file’
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:436: undefined reference
    to `flush_ogg_stream_to_file’
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:461: undefined reference
    to `add_eos_packet_to_stream’
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:462: undefined reference
    to `flush_ogg_stream_to_file’
    C:/android-ndk-r5c/apps/SpoorleClient/obj/local/armeabi/objs-debug/spoorle_Speex
    Lib/spoorle_SpeexLib.o: In function `out_file_open(char const*, int, int*)’:
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:670: undefined reference
    to `write_wav_header(__sFILE*, int, int, int, int)’
    C:/android-ndk-r5c/apps/SpoorleClient/obj/local/armeabi/objs-debug/spoorle_Speex
    Lib/speex_codec.o: In function `speexenc’:
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:392: undefined reference
    to `flush_ogg_stream_to_file’
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:436: undefined reference
    to `flush_ogg_stream_to_file’
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:461: undefined reference
    to `add_eos_packet_to_stream’
    C:/android-ndk-r5c/apps/SpoorleClient/jni/speex_codec.c:462: undefined reference
    to `flush_ogg_stream_to_file’
    collect2: ld returned 1 exit status
    make: *** [/cygdrive/c/android-ndk-r5c/apps/SpoorleClient/obj/local/armeabi/libs
    poorle_SpeexLib.so] Error 1

    • Hi,
      Sorry, I don’t know. I didn’t compile ogg. I only need libspeex.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: