简体   繁体   中英

Capturing the user's sound card output in a Java Applet

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, eg 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!

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

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).

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. 在此处输入图片说明

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM