1

ほぼ 1 か月間、プログラムは正常に動作しましたが、今日、プログラムを開始すると上記のエラーが発生します。エラーは次の行に表示されます。

sounds.put(key, (Clip)AudioSystem.getLine(new Line.Info(Clip.class)));

理由がわかりません。ここで受け入れられた回答を読んだ後、Eclipseを再インストールしたり、メタデータを削除したりしましたが、それでもエラーが発生します。コードは 100% 正しいですが、エラーの近くにコードを投稿する方法は間違っています。

protected SoundArchive(String soundArchive, boolean debugFrame){
    f = new File(this.getClass().getResource("../" + soundArchive).toString().substring(5)).listFiles();
    sounds = new HashMap<String, Clip>();
    try{
        for(int i = 0; i < f.length; i++){
            String key = f[i].toString().split("\\\\")[f[i].toString().split("\\\\").length - 1].split("\\.")[0];
            sounds.put(key, (Clip)AudioSystem.getLine(new Line.Info(Clip.class)));
            sounds.get(key).open(AudioSystem.getAudioInputStream(f[i]));
        }
    }
    catch(Exception e){
        e.printStackTrace(System.out);
    }
    if(debugFrame) debugFrame();
}

それで、私が今何をしなければならないか知っている人はいますか?壁に背を向けてしまった……。

4

0 に答える 0