我一直在测试一个适用于 PC 和 Android 平台的 Java 库,前段时间有人告诉我使用 JLayer。今天我很高兴地编码,然后出现了这个异常:
java.lang.ExceptionInInitializerError
at javazoom.jl.decoder.SynthesisFilter.load_d(Unknown Source)
at javazoom.jl.decoder.SynthesisFilter.<init>(Unknown Source)
at javazoom.jl.decoder.Decoder.initialize(Unknown Source)
at javazoom.jl.decoder.Decoder.decodeFrame(Unknown Source)
at javazoom.jl.player.Player.decodeFrame(Unknown Source)
at javazoom.jl.player.Player.play(Unknown Source)
at javazoom.jl.player.Player.play(Unknown Source)
at Main.Play(Main.java:23)
at Main.main(Main.java:164)
Caused by: java.io.IOException: unable to load resource 'sfd.ser'
at javazoom.jl.decoder.JavaLayerUtils.deserializeArrayResource(Unknown Source)
... 9 more
我试图用谷歌搜索此异常的原因,但没有任何结果,所以我来这里寻求您的帮助。
这是我试图播放音频文件的功能:
public static void Play()
{
try
{
InputStream fis = new FileInputStream("L://POO//MyWS//WakeUp!//Back in black.mp3");
Player p = new Player(fis);
p.play();
}
catch(FileNotFoundException e)
{
e.printStackTrace();
}
catch (JavaLayerException e)
{
e.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
catch(ExceptionInInitializerError e)
{
e.printStackTrace();
}
}
先感谢您!:D