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

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

Answers:

Answer

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.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.