如何在android中设置音频均衡器

前端之家收集整理的这篇文章主要介绍了如何在android中设置音频均衡器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在制作一个媒体播放器,其中需要设置均衡器效果使用“寻找Baar”作为“低音”,“可怕”,“摇滚”,“流行音乐”,“中等”..我有一个链接,其中做这个使用了一些NDK库..有没有任何 java库可以做到这一点,请任何解释这样做的逻辑是什么.我被困在这里2天.任何帮助将不胜感激…
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.equalizertab);


      f
   }
  } else {
   try {
    ((GlobalState) getApplicationContext())
      .resetEQ();
   } catch (RemoteException re) {
    // TODO:
   }
  }
 }
});

记录下面的猫:

05-25 11:52:16.630: E/AndroidRuntime(19088): FATAL EXCEPTION: main
05-25 11:52:16.630: E/AndroidRuntime(19088): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.apis.media/com.example.android.apis.media.AudioFxDemoActivity}: java.lang.RuntimeException: Cannot initialize Visualizer engine,error: -1
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1818)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1834)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.app.ActivityThread.access$500(ActivityThread.java:122)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1027)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.os.Looper.loop(Looper.java:132)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.app.ActivityThread.main(ActivityThread.java:4126)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at java.lang.reflect.Method.invokeNative(Native Method)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at java.lang.reflect.Method.invoke(Method.java:491)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at dalvik.system.NativeStart.main(Native Method)
05-25 11:52:16.630: E/AndroidRuntime(19088): Caused by: java.lang.RuntimeException: Cannot initialize Visualizer engine,error: -1
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.media.audiofx.Visualizer.<init>(Visualizer.java:182)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at com.example.android.apis.media.AudioFxDemoActivity.setupVisualizerFxAndUI(AudioFxDemoActivity.java:151)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at com.example.android.apis.media.AudioFxDemoActivity.onCreate(AudioFxDemoActivity.java:53)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
05-25 11:52:16.630: E/AndroidRuntime(19088):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1782)

解决方法

原文链接:https://www.f2er.com/android/314033.html

猜你在找的Android相关文章