小编Phu*_*ang的帖子

使用Android中的Opus Codec录制和播放

我正在开发一个需要用Opus Codec录制和播放的项目,我搜索了很多,但我找不到使用该解决方案的任何演示/示例.我发现有一个带编码器的演示但无法找到解码器.我只用C找到这个编解码器的源代码,你能帮帮我吗?

android encoder decoder recorder opus

7
推荐指数
1
解决办法
4752
查看次数

与android 5.0一起使用时java.lang.UnsatisfiedLinkError

我正在构建一个Android应用程序.使用Opus编解码器进行编码和解码.我在这里使用本地代码http://www.opus-codec.org/和这里的包装器https://github.com/jitsi/libjitsi/tree/master/src/native/opus.在Android 4.0+中,我创建了.so文件并运行,一切正常.但是在Android 5.0中,当我调用native方法时会崩溃.这是崩溃的细节:

 java.lang.UnsatisfiedLinkError: No implementation found for long my.package.name.codec.Opus.encoder_create(int, int) (tried Java_my_package_name_codec_Opus_encoder_1create and Java_my_package_name_codec_Opus_encoder_1create__II)
Run Code Online (Sandbox Code Playgroud)

我也搜索了很多,但找不到根本原因,没有人和我有同样的问题.下面是我的mk文件,我认为它很有用.

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

MY_MODULE_DIR       := opus

LOCAL_MODULE        := $(MY_MODULE_DIR)
LOCAL_SRC_FILES     := $(wildcard ( libopus/src/*.c \
    libopus/celt/*.c \
    libopus/celt/arm/*.c \
    libopus/silk/*.c \
    libopus/silk/arm/*.c \
    libopus/include/*.c \
    libopus/silk/fixed/*.c \
    my_package_name_codec_Opus.c ))

LOCAL_C_INCLUDES    := \
    libopus/src \
    libopus/include \
    libopus/silk \
    libopus/silk/fixed \
    libopus/silk/arm \
    libopus/celt \
    libopus/celt/arm \
    libopus \

LOCAL_CFLAGS        := -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
LOCAL_CFLAGS    += …
Run Code Online (Sandbox Code Playgroud)

java-native-interface android opus android-5.0-lollipop

7
推荐指数
1
解决办法
831
查看次数

如何在导出aar文件时包含依赖库

我正在实现一个具有推送通知和api的库项目.在这个库中,我使用了一些外部库,如playservice-gcm,gson,retrofit等.如果我用库项目编译示例,那么一切都很好.但是当我使用aar文件时,示例项目无法找到我使用的外部库.

下面是我的库的builde.gradle:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile ('com.android.support:appcompat-v7:22.2.0')
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
    compile 'com.squareup.okhttp:okhttp:2.0.0'
    compile 'com.jakewharton:butterknife:5.0.0'
    compile 'com.squareup.retrofit:retrofit:1.7.1'
    compile 'de.greenrobot:eventbus:2.2.1'
    compile 'com.google.android.gms:play-services-gcm:7.8.0'
    compile files('libs/commons-io-2.4.jar')
    compile 'com.j256.ormlite:ormlite-android:4.48'
    compile 'com.j256.ormlite:ormlite-core:4.48'
}
Run Code Online (Sandbox Code Playgroud)

以下就是一个例子

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//    compile project(':library') => this is the the libs having …
Run Code Online (Sandbox Code Playgroud)

android gradle android-gradle-plugin aar

6
推荐指数
1
解决办法
3854
查看次数