try {
WaveData data = WaveData.create(new BufferedInputStream(new FileInputStream("sound/test.wav")));
if (data == null) {
throw new LWJGLException("data == null");
}
sound = new SoundPlayer(new AudioClip(data));
} catch (LWJGLException | FileNotFoundException ex) {
Logger.getLogger(SoundDemo.class.getName()).log(Level.SEVERE, null, ex);
}
addKeyListener(this);
}