// Path: src/main/java/com/github/sunnybat/paxchecker/resources/ResourceLoader.java
// public class ResourceLoader {
// 
// 	/**
// 	 * Attempts to load the given file from the PAXChecker resources.
// 	 *
// 	 * @param fileName The name of the file to load
// 	 * @return The InputStream containing the File
// 	 * @throws FileNotFoundException If the file does not exist
// 	 */
// 	public static InputStream loadResource(String fileName) throws FileNotFoundException {
// 		File inputFile = new File(ResourceConstants.RESOURCE_LOCATION + fileName);
// 		InputStream in = new java.io.FileInputStream(inputFile);
// 		return in;
// 	}
// 
// }


import com.github.sunnybat.commoncode.error.ErrorBuilder;
import com.github.sunnybat.paxchecker.resources.ResourceLoader;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.LineEvent;
import javax.sound.sampled.LineListener;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
			new ErrorBuilder()
					.setErrorTitle("Cannot use audio file")
					.setErrorMessage("Currently, the only supported alarm audio format is .WAV files. If you would like"
							+ " to see support for other audio formats, let me know!")
					.buildWindow();
		} else {
			Audio.alarmFile = alarmFile;
			System.out.println("Set alarm file to " + alarmFile.getName());
		}
	}

	/**
	 * Plays the alarm. Note that this checks {@link #soundEnabled()} to make sure it's supposed to
	 * play. This method only allows one sound to play at a time, and resets the sound currently
	 * playing to the beginning.
	 *
	 * @return True if the alarm was successfully started, false if not
	 */
	public static boolean playAlarm() {
		if (!playSound) {
			return false;
		}
		try {
			if (clip != null) {
				clip.stop();
			}
			InputStream audioSrc;
			if (alarmFile != null) {
				audioSrc = new FileInputStream(alarmFile);
			} else {
// Path: src/main/java/com/github/sunnybat/paxchecker/resources/ResourceLoader.java
// public class ResourceLoader {
// 
// 	/**
// 	 * Attempts to load the given file from the PAXChecker resources.
// 	 *
// 	 * @param fileName The name of the file to load
// 	 * @return The InputStream containing the File
// 	 * @throws FileNotFoundException If the file does not exist
// 	 */
// 	public static InputStream loadResource(String fileName) throws FileNotFoundException {
// 		File inputFile = new File(ResourceConstants.RESOURCE_LOCATION + fileName);
// 		InputStream in = new java.io.FileInputStream(inputFile);
// 		return in;
// 	}
// 
// }


// Path: src/main/java/com/github/sunnybat/paxchecker/Audio.java
import com.github.sunnybat.commoncode.error.ErrorBuilder;
import com.github.sunnybat.paxchecker.resources.ResourceLoader;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.LineEvent;
import javax.sound.sampled.LineListener;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;

			new ErrorBuilder()
					.setErrorTitle("Cannot use audio file")
					.setErrorMessage("Currently, the only supported alarm audio format is .WAV files. If you would like"
							+ " to see support for other audio formats, let me know!")
					.buildWindow();
		} else {
			Audio.alarmFile = alarmFile;
			System.out.println("Set alarm file to " + alarmFile.getName());
		}
	}

	/**
	 * Plays the alarm. Note that this checks {@link #soundEnabled()} to make sure it's supposed to
	 * play. This method only allows one sound to play at a time, and resets the sound currently
	 * playing to the beginning.
	 *
	 * @return True if the alarm was successfully started, false if not
	 */
	public static boolean playAlarm() {
		if (!playSound) {
			return false;
		}
		try {
			if (clip != null) {
				clip.stop();
			}
			InputStream audioSrc;
			if (alarmFile != null) {
				audioSrc = new FileInputStream(alarmFile);
			} else {
				audioSrc = ResourceLoader.loadResource("Alarm.wav");