Well, the title says all, I tried playing a wav file using javax.sound and nothing is happening. I have tried many different files without any luck.
public static void main(String[] args) throws IOException, UnsupportedAudioFileException, LineUnavailableException
{
File in = new File("C:\Users\Sandra\Desktop\music\rags.wav");
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(in);
Clip play = AudioSystem.getClip();
play.open(audioInputStream);
FloatControl volume= (FloatControl) play.getControl(FloatControl.Type.MASTER_GAIN);
volume.setValue(1.0f); // Reduce volume by 10 decibels.
play.start();
}
See Question&Answers more detail:os