Remove system exits

This commit is contained in:
Rob Judd 2016-10-24 11:20:13 +10:00
parent dc784cf029
commit 1cc9ba75ce

View File

@ -19,13 +19,7 @@ package io.bitsquare.gui.util;
import java.io.File;
import java.io.IOException;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.SourceDataLine;
import javax.sound.sampled.*;
public class MakeSound {
@ -35,9 +29,7 @@ public class MakeSound {
private AudioFormat audioFormat;
private SourceDataLine sourceLine;
/**
* @param filename the name of the file that is going to be played
*/
/* @param filename the name of the file that is going to be played */
public void playSound(String filename){
String strFilename = filename;
@ -46,14 +38,12 @@ public class MakeSound {
soundFile = new File(strFilename);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
try {
audioStream = AudioSystem.getAudioInputStream(soundFile);
} catch (Exception e){
e.printStackTrace();
System.exit(1);
}
audioFormat = audioStream.getFormat();
@ -64,10 +54,8 @@ public class MakeSound {
sourceLine.open(audioFormat);
} catch (LineUnavailableException e) {
e.printStackTrace();
System.exit(1);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
sourceLine.start();