本文介绍了如何在Java中暂停录音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一个应用程序来录制麦克风中的音频,并且工作正常.现在,我想在其中实现暂停和恢复功能,但是我没有得到如何暂停流的信息.
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);在代码段中的
中,您可以看到AudioSystem.write正在将流写入文件. 现在我不知道如何暂停和恢复此写入方法,因此请指导我.
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.
谢谢
推荐答案尝试调用 AudioInputStream.close().
更多推荐
如何在Java中暂停录音
发布评论