如何在Java中暂停录音

编程入门 行业动态 更新时间:2024-10-24 15:14:39
本文介绍了如何在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中暂停录音

本文发布于:2023-11-27 03:03:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636298.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!