Search code examples
javascriptaudioweb-audio-api

How to Access Website Audio Source with Javascript?


So, I would like to use the Web Audio API to manipulate audio that is streaming from websites. (For example, create a dynamic bass boost for listening via Soundcloud.)

I'm familiar with the Web Audio API and know how to use it to stream audio from the microphone or create a synthesizer.

However, I cannot determine is the Web Audio API (or Javascript, in general) is capable of "grabbing" audio from an already existing audio source. Is it possible to access audio from a site?

Thanks.


Solution

  • No, this is not something that the Web Audio API can do. Media elements must be available within the document to use them for a MediaElementAudioSourceNode.

    (And it will probably never be possible on a cross-origin basis -- browser developers generally take a dim view of APIs that could potentially lead to information leaking across origins.)