etlaM
etlaM

Reputation: 140

System Sound as Input (Web Audio API)

Is there any way to take the system's sound as an input for the Web Audio API?

For example take a user's spotify music that is playing as an input and analyze it to do stuff with it?

Upvotes: 4

Views: 794

Answers (1)

chrisguttandin
chrisguttandin

Reputation: 9076

There is a specification which almost does what you want. It's the counterpart of the Media Capture and Streams spec (aka getUserMedia()).

navigator.mediaDevices.getDisplayMedia();

The spec is called Screen Capture and as the name implies it is meant for capturing video and not audio. Capturing audio is optional and not yet supported by any browser if I recall correctly.

There is currently an open issue discussing audio-only support. Maybe it's a good idea to share your use case there.

Upvotes: 4

Related Questions