Our great sponsors
-
developer.chrome.com
Discontinued The frontend, backend, and content source code for developer.chrome.com
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I experimented and tested considerably with this (capturing output devices on Chrome and Chromium). There are several ways to achieve the requirement in the linked GitHub repostories. I use Native Messaging to capture audio output to speakers and headphones, and/or specific sink inputs https://github.com/guest271314/captureSystemAudio/tree/master/native_messaging/capture_system_audio. I wrote the same algorithm for a Native Messaging host in Python, Bash, C, C++, Node.js, Deno, QuickJS - for the people!
Keep in mind that getDisplayMedia() does not capture all audio output to speaker or headphones, e.g., does not capture window.speechSynthesis.speak() output, which is not output via the Tab audio, see https://github.com/GoogleChrome/developer.chrome.com/issues/3957.