Q:

Got an exception while working with javax.sound.samples library....! 

Can anyone tell me where i have done mistake in this java program. 
I always get an exception caught while i run this. 
import java.io.*; 
import javax.sound.sampled.*; 
public class x 
{
 public static void main(String args[])
 {
  try
  {
  File f=new File("mm.wav");
  AudioInputStream a=AudioSystem.getAudioInputStream(new FileInputStream(f));
  AudioFormat audioFormat = a
                   .getFormat();
             DataLine. Info dataLineInfo = new DataLine. Info(
                   Clip.class, audioFormat);
             Clip clip = (Clip) AudioSystem
                   .getLine(dataLineInfo);
             clip.open(a);
             clip.start();
 }
 catch(Exception e)
 {
  e.printStackTrace();
  System.out.println("exception caught ");
 }
 }
}

It will throws this exception
java.io. IOException: mark/reset not supported
    at java.io. InputStream.reset(InputStream.java:351)
    at com.sun.media.sound. SoftMidiAudioFileReader.getAudioInputStream(SoftMidiAudioFileReader.java:135)
    at javax.sound.sampled. AudioSystem.getAudioInputStream(AudioSystem.java:1111)
    at x.main(x.java:10)

A:

EDITED:
After testing your code, I get the same error every time I try to give your code an invalid sound file (I gave it text files and binary java class files :) ).   I got the same exception every time.   It's not a very user-friendly exception, but check the validity of your wav file. 
EDIT #2:
If I change the code to:
  AudioInputStream a=AudioSystem.getAudioInputStream(
      new BufferedInputStream(new FileInputStream(f)));

then an invalid sound file will give the more pleasing exception:  UnsupportedAudioFileException

