我正在尝试通过Android中的类InputStream inputStream = ftpClient.retrieveFileStream(totalFilePath);
BufferedImage bimg = ImageIO.read(inputStream);
inputStream.close();
if (!ftpClient.completePendingCommand()) {
// Throw some error or do something, file transfer failed
}
使用this example。
但是每次我尝试时,都会发生此错误:
Visualizer
错误发生在这里:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: br.cericatto.audioeffects, PID: 11754
java.lang.RuntimeException: Unable to start activity ComponentInfo{... .AudioFxDemo}: java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -3
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -3
at android.media.audiofx.Visualizer.<init>(Visualizer.java:218)
at ... .AudioFxDemo.setupVisualizerFxAndUI(AudioFxDemo.java:176)
at ... .AudioFxDemo.onCreate(AudioFxDemo.java:71)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
更具体地说,在第176行:
at ... .AudioFxDemo.setupVisualizerFxAndUI(AudioFxDemo.java:176)
at ... .AudioFxDemo.onCreate(AudioFxDemo.java:71)
我尝试在没有设置权限的情况下运行,也没有设置权限,并且发生相同的错误。 也许我在错误的地方设置了权限?也许是导致错误的另一个原因,我不确定。