在 Java 中,如何记录传到扬声器的声音输出?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11157289/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
In Java, how do I record the sound output that is going to the speakers?
提问by Matt
I have a java application that is taking in sound from multiple sources, and one of the abilities of the user is to record what is happening in the application to an AVI file, and I would like to include the sound in that video capture. How do I record the sound that the user would hear (ex. a result of all of the sound inputs mixed together)? I can figure out how to get the actual sound stream in to the video, but I am not sure where to get that sound source from.
我有一个从多个来源接收声音的 Java 应用程序,用户的一项能力是将应用程序中发生的事情记录到 AVI 文件中,我想在该视频捕获中包含声音。如何录制用户会听到的声音(例如,所有声音输入混合在一起的结果)?我可以弄清楚如何将实际的声音流输入到视频中,但我不确定从哪里获得该声源。
回答by Scotch
Have you read the java tutorial on this? There's a lot of information that pertains to your question in Accessing Audio System Resources.
你读过关于这个的java教程吗?访问音频系统资源中有很多与您的问题有关的信息。
It details some recommended classes to use and provides examples of their implementation.
它详细介绍了一些推荐使用的类并提供了它们的实现示例。