在 Java Applet 中捕获用户的声卡输出

发布于 2024-10-30 14:44:00 字数 210 浏览 1 评论 0原文

我正在寻找一种方法来捕获用户的声卡输出并通过 RTMP 将其实时流式传输到 red5 服务器。

使用音频重定向(例如,与 Windows Stereo Mix 一起使用)不是一种选择,因为它非常难以配置,并且在不同配置和 Windows 版本之间无法一致工作。

我对这个方向上的各种解决方案可能性持开放态度 - 甚至可能使用 JNI/JNA?

感谢您的建议!

I'm looking for a way to capture the sound card output of users and stream it to a red5 server via RTMP in real time.

Using audio redirecting, e.g. with the Windows Stereo Mix is not an option, as it is pretty difficult to configure and it doesn't work consistently across configurations and Windows versions.

I'm open for all sorts of solution possibilities in this direction - maybe even with JNI/JNA?

Thanks for your suggestions!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

累赘 2024-11-06 14:44:00

如果您愿意使用 JNI/JNA,为什么不通过 C++ 或 C 访问声音驱动程序,那会容易得多,因为无论如何您将用 Java 编写接口,但它们的实现将用 C++ 或 C 编写。

If you are open to using JNI/JNA why not access the sound driver via C++ or C, that would much be easier because anyway you are going to write the interface in Java but their implementation would be in C++ or C.

冷默言语 2024-11-06 14:44:00

请参阅 Java 教程中的捕获音频

小程序需要经过数字签名并受到最终用户的信任,然后才能拦截声音线路中的数据。

如果没有启用软件或硬件“音频环回”,则它可能会完全失败(即使在完全受信任的小程序中)。

See Capturing Audio in the Java Tutorial.

An applet will need to be digitally signed as well as trusted by the end user, before it will be possible to intercept the data in the sound lines.

If no software or hardware 'audio loop-back' is enabled, it might fail completely (even in a fully trusted applet).

起风了 2024-11-06 14:44:00

好的 - Java 中绝对没有本地方法可以从浏览器中捕获声卡输出。可以使用 Java 本机接口编写特定于平台的代码来截取该行并将原始音频数据传递给小程序以进一步处理它。

Ok - there is definitely no native way in Java to capture the sound card output out of the browser. It is possible to use the Java Native Interface to write platform-specific code to intercept the line and pass the raw audio data to the applet to further process it.

国粹 2024-11-06 14:44:00

这并不像看起来那么微不足道。

您需要做什么[第 1 部分 - 创建存储信息的位置]:

  • 描述服务器、存储文件的位置。 (例如:Google App Engine)
  • 描述您希望如何存储文件。 (例如:数据存储)
  • 描述数据完整性的重要性。 (例如:使用现有的上传 api 上传文件,然后传输数据会更容易。示例 Apache FileUpload)

假设您想要上传到的最大大小为 1 mb 的文件(例如 .ogg)音频文件服务器数据库。如果您要创建一个自动上传器,您还可以创建一个可以手动使用的网页前端。

如果您希望问题得到解答,请提出明确的问题,以便人们可以回答。如果您不指定限制,那么在我看来,这是不专业的,至少我永远不会编写复杂的解决方案。


抱歉,我最初的回答对您没有用。我试图简化问题,但我过度简化了。 “一切都应该尽可能简单,但不能更简单。” A.爱因斯坦。

作为您问题的潜在解决方案,我可以推荐:

  • Screener - a Java 程序,不仅可以传输音频,还可以包含截屏视频。 在此处输入图像描述

如果它不能解决您的问题,那么我希望它至少对您有用。

This is not as trivial, as it might seem.

What you need to do [ part 1 - creating a place to store the info ]:

  • describe the server, where to store the file. (for example: Google App Engine)
  • describe how you want to store the file. (for example: datastore)
  • describe how important is the integrity of the data. (for example: it's easier to upload a file, with existing upload api, then to stream data. Example Apache FileUpload)

Lets say you have maximum size of 1 mb file, (example .ogg) audio file, that you want to upload to a server database. If you are going to create a automation uploader, you might aswell create a webpage frontend, that you can manually use.

If you want your questions answered, then form clear question, that people can answer. If you do not specify the limits, then it is IMO nonprofessional, and at least I will never write a complex solution.


Sorry, that my initial answer was not useful for you. I tried to simplify the problem, but I over simplified it. "Everything should be made as simple as possible, but not simpler." A. Einstein.

As a potential solution to your problem, I could recommended:

  • Screener - a Java program, that not only streams audio, but also includes screencast video. enter image description here

If it does not solve your problem, then I hope it's at least useful for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文