【问题标题】:Soundtouch library compile issueSoundtouch 库编译问题
【发布时间】:2013-09-17 23:36:32
【问题描述】:

我正在尝试使用 Android NDK 编译 Soundtouch 库。我成功安装了 Soundtouch 库所需的 Cygwin 和 SWIG。当我尝试运行 ndk-build.cmd 时,出现错误

jni/soundtouch/wrapper_wrap.cpp: 在函数 'void Java_com_talkingyeti_jni2_wrapperJNI_SoundTouch_1putSamples(JNIEnv*, _jclass*, jlong​​, _jobject*, jlong​​, jlong​​)'中: jni/soundtouch/wrapper_wrap.cpp:545:错误:“SAMPLETYPE”未在此范围内声明 jni/soundtouch/wrapper_wrap.cpp:545: 错误: 'arg2' 未在此范围内声明 jni/soundtouch/wrapper_wrap.cpp:553: 错误: ')' 标记之前的预期主表达式 jni/soundtouch/wrapper_wrap.cpp:560: 错误: 预期 ')' 在 'const' 之前 jni/soundtouch/wrapper_wrap.cpp:560: 错误:在 ';' 之前预期 ')'令牌 make: * [obj/local/armeabi/objs/soundtouch/wrapper_wrap.o] 错误1

此问题发生在以下 wrapper_wrap.cpp 块中:

  SWIGEXPORT void JNICALL Java_com_talkingyeti_jni2_wrapperJNI_SoundTouch_1putSamples(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) {
  soundtouch::SoundTouch *arg1 = (soundtouch::SoundTouch *) 0 ;
  SAMPLETYPE *arg2 = (SAMPLETYPE *) 0 ;
  uint arg3 ;
  uint *argp3 ;

  (void)jenv;
  (void)jcls;
  (void)jarg1_;
  arg1 = *(soundtouch::SoundTouch **)&jarg1; 
  arg2 = *(SAMPLETYPE **)&jarg2; 
  argp3 = *(uint **)&jarg3; 
  if (!argp3) {
    SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null uint");
    return ;
  }

请建议我需要对 SAMPLETYPE 进行哪些更改才能正确编译 NDK 并生成 SO 文件。

【问题讨论】:

    标签: android android-ndk java-native-interface android-audiorecord soundtouch


    【解决方案1】:

    您似乎错过了一个标题。确保你有:

    #include "soundtouch/include/SoundTouch.h"
    

    using namespace soundtouch;
    

    【讨论】:

    • 您是否在应用中集成了 soundtouch 库?
    • 是的,在Android App中是要修改声音节奏的
    • @mmdc 我又遇到了这个问题,你能分享一下示例代码吗?谢谢
    猜你喜欢
    • 2018-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多