obs-linuxbrowser icon indicating copy to clipboard operation
obs-linuxbrowser copied to clipboard

Custom audio routing / Browser sound listed in OBS mixer

Open shrhoads opened this issue 7 years ago • 11 comments

Is it possible to have the sound from obs-linuxbrowser available on a virtual sound device and/or have it in the mixer. Another option which may be available is to have obs-linuxbrowser have a configuration setting to put the sound on a defined virtual microphone as an alternative to desktop output in a config setting. Would like the ability to have two instances of obs running and sound not interfere from one to another.

shrhoads avatar May 01 '17 14:05 shrhoads

Unfortunately CEF does not provide any way to control audio in browser right now. I guess I could add an option to control which audio device is used for output, would have to implement it using alsa/pulseaudio though.

bazukas avatar May 01 '17 20:05 bazukas

That would be good enough for now.

shrhoads avatar May 01 '17 20:05 shrhoads

If you use PulseAudio, you can create a Null sink and point the CEF source via pavucontrol to that Null sink (or a Combine sink if you want to monitor the sound independently).

NexAdn avatar May 02 '17 14:05 NexAdn

Am I able to configure the CEF source somehow using the current obs-linuxbrowser? How would I configure that?

shrhoads avatar May 03 '17 03:05 shrhoads

As NexAdn suggested, you can use pavucontrol to configure linuxbrowser instances. In the "playback" tab, select one of the "Chromium" applications and set it's volume and output device (unfortunately no way to tell apart different linuxbrowser instances and real chromium applications)

bazukas avatar May 03 '17 06:05 bazukas

Ok, do you want me to close this issue?

shrhoads avatar May 03 '17 14:05 shrhoads

No, I'm still planning to implement audio controls, so I'll close it myself when done.

bazukas avatar May 03 '17 14:05 bazukas

So I've spent some time working on this and it turned out that what I had in mind is not really applicable, since chromium opens and closes pulseaudio streams only when necessary. So I won't be able to set the output device and volume level at any point in time, unfortunately.

Will have to leave this open in case any other ideas come to mind.

bazukas avatar Aug 14 '17 11:08 bazukas

Maybe we can implement an automatic device switch every time the source gets activated (as I did with automatic reload on scene activation)

NexAdn avatar Nov 29 '17 18:11 NexAdn

I know this is an old issue with not a lot of movement, but I wanted to say that I would love it if there were a way to stabilize where audio output goes. I do a lot with pulseaudio and jack to try to limit capture to only the applications I want on my stream, but with chromium and obs-linuxbrowser sources indistinguishable in pavucontrol and choosing in a seemingly arbitrary fashion to sometimes remember where they were set and sometimes grab something else, keeping stream alerts on stream and e.g. Hangouts notifications off is a challenge.

I realize this is primarily a chromium problem, but if there's a solution at this end it would be really nice.

marcmagus avatar Jul 30 '18 17:07 marcmagus

https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/setSinkId

You could use a custom JavaScript to set the output device of the media elements in your website manually.

@marcmagus

NexAdn avatar Aug 27 '18 21:08 NexAdn