I am a Java newbie, so please bear with me and help.
I aim to first play then record sound.
I use netbeans IDE 6.8. Here is the code:
import java
Replace your main with :
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
Reg1 r = new Reg1();
try {
AudioInputStream audio = AudioSystem.getAudioInputStream(new File("name.wav"));
Clip clip = AudioSystem.getClip();
clip.open(audio);
clip.start();
}
catch (Exception e) {
System.out.println(e);
}
r.captureAudio();
}
});
}