I am writing an application to record audio from microphone and it is working fine. Now I want to implement pause and resume functionality in it but I am not getting how to pause the stream.
Following is the code to write audio to the file:
targetDataLine.open(audioFormat);
targetDataLine.start();
AudioSystem.write(new AudioInputStream(targetDataLine), fileType, audioFile);
in the code snippet you can see AudioSystem.write
is writing stream to file.
Now I am not getting how to pause and resume this write method so please guide me on this.
Thanks