The code
import javax.sound.sampled.*;
import java.io.*;
public class Tester {
static Thread th;
public static void main(String[] args) {
sta
import javax.sound.sampled.*;
import java.io.*;
import javax.swing.*;
public class Tester {
static Thread th;
public static void main(String[] args) throws Exception {
Clip clip = AudioSystem.getClip();
AudioInputStream ais = AudioSystem.getAudioInputStream(new File("d:/UnderTest/wavtester.wav"));
clip.open(ais);
clip.loop(0);
// Calculate totalFrames
long totalFrames = (long)(clip.getFrameLength() * clip.getFormat().getFrameRate());
Thread.sleep( ( totalFrames* 1000 )); // pause the thread till the sound plays
System.out.println(clip.getFrameLength());
System.out.println(clip.getFormat().getFrameRate());
}
}