Howto configure noisecancellation in meetings apps

64 views
Skip to first unread message

Sebastian Onofrei

unread,
Mar 2, 2023, 8:11:25 PM3/2/23
to Chromium-dev
Hello guys,

I'm wondering what would need changing in Chromium sourcecode to disable noise cancellation for the music played in youtube for example?

Let's say I'm a creator, streaming on some website yoga courses or whatever, and I want to also have some music from youtube running in the streaming.
I just discovered recently (probably it's a new feature in Chrome) that my streaming only contains real sounds i make, and nothing coming from YouTube. If I open youtube in some separate browser it works, but never if youtube plays in the same chrome where I do the streaming.

Many thanks

guest271314

unread,
Mar 3, 2023, 9:25:02 PM3/3/23
to Chromium-dev, Sebastian Onofrei
There is no Web API, nor Chromium or Chrome source code that I am aware of, for Linux, which provides a means to capture system audio, "What-U-Hear" from speakers or headphones.

You can use navigator.mediaDevices.getDisplayMedia() (even though there is a systemAudio option Chrome and Chromium do not actually capture entire system audio, only audio output to the captured Tab) to capture Tab audio (and video, where the video track can be removed from the MediaStream) on YouTube and on the same Tab use navigator.mediaDevices.getUserMedia() to capture microphone input.

Connect each respective MediaStreamTrack to a Web Audio API MediaStreamAudioDestinationNode then connect the MediaStreamTrack from MediaStreamAudioDestinationNode which will be a merged stream input of all audio nodes connected thereto, to MediaStreamAudioSourceNode for audio output (MediaStreamAudioDestinationNode on Chrome and Chromium do not output silence per specification the last time I checked). Alternative you can use MediaStreamTrackGenerator to manually create a single MediaStreamTrack with multiple inputs.

You can now share the merged Web Audio API MediaStream with peers, e.g., see Is it possible to mix multiple audio files on top of each other preferably with javascript.

guest271314

unread,
Mar 3, 2023, 9:31:08 PM3/3/23
to Chromium-dev, guest271314, Sebastian Onofrei
Reply all
Reply to author
Forward
0 new messages