I hate to tell you that, but
in general case this is absolutely
impossible. My comment to the question should give you some hint.
However, you can
cover some special simple cases, maybe for some specific sites. For example, if the pages contain background music or just downloadable audio files via
href
, you can simply download music source:
http://www.thesitewizard.com/webdesign/backgroundmusic.shtml[
^].
In such simple cases, you would need to use the
Web scraping techniques,
http://en.wikipedia.org/wiki/Web_scraping[
^].
For more detail, please see my past answers:
get specific data from web page[
^],
How to get the data from another site[
^].
There are much more difficult cases that are really hard to cover. The site can use
audio streaming and use many different protocols which are hard to cover just because it's hard to implement them all, and direct download is not available, because this is not pure HTTP. Some protocols are proprietary, not properly documented and are modified from time to time; one notoriously difficult case is Microsoft MMS or HMMS, MMS via HTTP. For example, FFMpeg can cope with downloading such a stream. Even if you cover many protocols, you cannot guarantee that something else is used.
And finally, you may be curious why I used such strong expression as "absolutely impossible". Well, because this is so in a general case. The site can use some algorithm of pseudo-random, more exactly, theoretically unpredictable sequence of audio samples; another variant of this idea is automatic generation of music. There is a very general theorem in computer science telling us that prediction of algorithm behavior is in general case theoretically impossible. (See for example,
http://en.wikipedia.org/wiki/Halting_problem[
^].) And, in practice, it's "even more impossible" :-), because you don't even have access to such unpredictable algorithm; it is hidden on the server part of the site…
The general problem of scraping of all site's audio output does not even make sense.
—SA