开发者

Is there a way of recording audio of streaming broadcast from a webpage?

开发者 https://www.devze.com 2023-03-09 05:05 出处:网络
I\'m looking to create webpage for record streaming audio from source (like online radio). At first I thought of doing something like recording from speakers, but solutions like flash, java and javas

I'm looking to create webpage for record streaming audio from source (like online radio).

At first I thought of doing something like recording from speakers, but solutions like flash, java and javascript refer to recording from microphone and not directly from speakers.

Other alternative is to try capturing the streaming and save to local file, but I couldn't find any way of doing so from a webpage. Solu开发者_运维技巧tions like this refer to iPad platfrom, and not suitable for standard webpage.

Any help will be much appreciated, as any development environment (python, ruby, php..).


The sound coming through the system is generally (1) available through one of the TargetDataLines of the Java Sound (sampled) API. Hook into that TargetDataLine & write the bytes directly to disk.

(Assuming you have the right to do so, of course.)

See the Capturing Audio lesson in the Java Tutorial for details. See my answer to JavaSound mixer with both Port(s) and DataLine(s)? for source to easily explore the available data lines. It is probably the "Primary Sound Capture Driver" that you need for this.

Java code must be trusted (or running with no security manager) to eavesdrop on the sound lines.

  1. On some systems Java Sound does not seem to be able to detect all the lines. For those systems, there is little short of a hardware based audio loop-back (e.g. a cable connecting the speaker output back to the microphone) that will fix the problem.
0

精彩评论

暂无评论...
验证码 换一张
取 消