1Clip clip;
2
3try {
4 AudioInputStream input=AudioSystem.getAudioInputStream(new File("audio.wav"));
5 clip=AudioSystem.getClip();
6 clip.open(input);
7 clip.start();
8} catch (UnsupportedAudioFileException e) {
9 e.printStackTrace();
10} catch (IOException e) {
11 e.printStackTrace();
12} catch (LineUnavailableException e) {
13 e.printStackTrace();
14}