I'm working on in a java project that helps people to learn the location of countries in the map.
The program plays a .wav sound file when the mouse passes over an object and works perfectly running in Windows but today I tried to so the same in Ubuntu and the program throws the next Exception:
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
This is the method that plays the sound.
public void playSound(String audioName){
String path="src/audio/"+audioName+".wav";
try{
Clip sound=AudioSystem.getClip();
sound.open(AudioSystem.getAudioInputStream(new File(path)));
sound.start();
} catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
}
Could anyone tell me how can I solve this issue?
I've been searching a lot but I haven't found a clear answer that help me.
I think there are some important things I didn't specified...
The exception I mentioned before is thrown when the event mouseEntered is fired but this is a little strange because the program doesn't have any problems at first glance. The sound in reproduced correctly at the beginning and the exception is thrown after I pass the mouse over some of the objects.