Search code examples
javascripthtmlgoogle-chromeaudionpapi

Clone Chrome audio output


I'm trying to find a way to capture all audio output from a page, be it a youtube video, or a silverlight movie, or an annoying banner ad.

My original idea was to inject javascript and html5 tags into the page, but that has proven fruitless for the most part.

One idea is to simply redirect the audio stream from the users speakers into the users microphone and record it that way.

I'm pretty much open to any approach for this, I realize it's very likely I'll have to write a plugin (this is after a rather exhaustive search for a method using HTML5 and javascript).

Has anyone tried something similar or could point me in a helpful direction? I'm thinking at this point digging into NPAPI might be helpful.


Solution

  • NPAPI doens't have any APIs for audio; all NPAPI plugins that do audio do so using system APIs. Because of this (and both Flash and silverlight are NPAPI plugins on most browsers, though recent flash is PPAPI) there is no way to capture all audio specifically for a given page, tab, or even browser -- unless there is a system API that will get it for you by HWND or something, which is possible, but I don't know.

    What you might be able to do is use a system API to capture all audio on the system.

    Remember also that silverlight and flash are plugins and thus have nothing to do with HTML5.