obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
790 stars 228 forks source link

Browser source SpeechSynthesis audio is not recorded when "Control audio via OBS" is selected #404

Open Edrem opened 1 year ago

Edrem commented 1 year ago

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

29.0.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/OXxpPl8wZ7n4t9ts

OBS Studio Crash Log URL

No response

Expected Behavior

SpeechSynthesis done inside a browser when set to "Control Audio via OBS" should be recorded on it's own audio channel in OBS, as well as be monitored if the monitor setting is enabled in Advanced Audio

Current Behavior

OBS should be able to both record and monitor the speechsynthesis audio generated by a browser source when "Control Audio via OBS" is enabled, instead it simply records nothing.

The browser source is capable of generating speechsynthesis audio when the option is off, that however goes through Desktop Audio/Default Output and is not ideal for my recording setup.

Steps to Reproduce

  1. Add a new browser source pointing to Mozilla SpeechSynthesis demo page (https://mdn.github.io/dom-examples/web-speech-api/speak-easy-synthesis/)
  2. Set the source property "Control Audio via OBS" to true
  3. In Advanced Audio properties for the browser sauce, set Audio Monitoring to Monitor Only/Monitor and Output
  4. Using the Interact tool with the browser sauce, type in some text and click Play.

Anything else we should know?

Thank you whoever made the Analyzer of OBS log files. It's most likely unrelated to this issue but I can see now some other performance settings in OBS I was never aware of.

pkviet commented 1 year ago

I can indeed repro the issue. It's unfortunately probably not fixable on our side. The audio capture functions are never called. This points to cef (chromium embedded framework) which we rely on for obs-browser. Could you try a speech synthesis which auto starts as soon as the page is open ? Maybe this would work.

nofuture2077 commented 1 year ago

I can reproduce the error on Mac OS. One thing to add: The SpeechSynthesis doesn't even start when audio is controlled by obs.

const audio = new SpeechSynthesisUtterance("Test Message");
audio.addEventListener('start', () => {
    //...
});
speechSynthesis.speak(audio);

So the audio starts and start event is fired when "Control audio via OBS" is disabled, but doesn't if it is checked.

Dizziness17 commented 2 months ago

I have same issue with this. I used Web Speech API and it works on chrome but not obs. Did anyone solved this?