I am working on a maven project and need to play a .wav file to accompany a desktop alert. I have tested the .wav file on its own to make sure that it works and it does. I have imported it into my project structure and when it is in the source directory, it is 46 KB. When I perform mvn clean install on the project, the target directory that is generated contains the .wav file, but it is 87 kb there.
This is the error that I get: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file
I put in a logging statement to check the generated path in my log4j logs and the path is correct. This makes me think that the mvn clean install is modifying the format or contents of the .wav file, but I don't understand how and ultimately how to prevent it from happening.
Update
Here is a code snippet:
String filename = this.getClass().getResource("/audio/affirmative.wav").getPath();
logger.debug("wav file path: " + filename);
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File(filename).getAbsoluteFile());
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.start();
Any ideas? Thanks in advance!