gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:25:24 32 4
gpt4 key购买 nike

我正在制作一个媒体播放器,其中需要使用“seek bar”设置均衡器效果为“Bass”、“terrible”、“Rock”、“Pop”、“Medium”。我得到了一个链接,其中使用了一些 NDK 库。是否有任何 Java 库可以做到这一点,请解释一下这样做的逻辑是什么。

 @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)

最佳答案

您可以在 AudioFxDemo 类中找到均衡器。

这是您可以找到锻炼权限的链接:

Android Visualizer implementation crash

关于android - 如何在 Android 中设置音频均衡器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10738278/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com