rianlu / fluidsynth-android-play-note

Repo for following along Hello World Fluidsynth tutorial from Medium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FluidSynth For Android

因为目前需求只需要使用FluidSynth播放对应key,所以对原来的库做了些修改:

  • 基于main分支

  • 移除一些无关的库

  • libs 移到了 jniLibs

  • 新增三个方法,其实就是把原先提供的方法进行了拆分

    public native void loadSoundFont(String soundfontPath);
    
    public native void playNote(int key);
    
    public native void release();

存在问题:在 Android 7.0 以下会闪退,错误日志如下:

Process: com.example.fluidsynthandroidhelloworld, PID: 13027
    java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "in6addr_any" referenced by "/data/app/com.example.fluidsynthandroidhelloworld-1/lib/x86/libfluidsynth.so"...
        at java.lang.Runtime.loadLibrary(Runtime.java:372)
        at java.lang.System.loadLibrary(System.java:1076)

另一分支 opensles 中使用另一个项目fluidsynth-android-opensles编译出的 so 库替换,可以解决闪退的问题,但是同样在Android 7.0 以下不能播放,并且在初始化的时候会有一声异响。。。

原作者博客地址:Creating a Fluidsynth Hello World App for Android

opensles 作者地址:[fluidsynth-android-opensles](https://github.com/degill/fluidsynth-android-opensles)

About

Repo for following along Hello World Fluidsynth tutorial from Medium


Languages

Language:C 82.2%Language:Java 8.0%Language:CMake 7.0%Language:C++ 2.9%