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

[Feature Request] Audio Volume Control

Open AlexFreik opened this issue 1 year ago • 3 comments

Hello! Sometimes when we're playing music we want to slowly fade it out before transitioning to next scene. Is there any plans to impliment some kind of Audio Mixer via GetInputVolume and SetInputVolume? Screenshot 2024-05-04 at 12 35 27

AlexFreik avatar May 04 '24 07:05 AlexFreik

I can't recall how I did it previously with obs-web, but it was an old version. And I still need this too, will update here or with a PR once I find it.

bilogic avatar May 05 '24 03:05 bilogic

I hacked it like this in App.svelte and it's really old, setScene() no longer exists in the latest version

  async function setScene(e) {
    let newscene = await e.currentTarget.textContent;
    let i = 0;
    let full_volume = -16.5;
    full_volume = -100; // 0%
    full_volume = -20; // 10%
    full_volume = -16.5; // 15%
    full_volume = 0; // 100%

    if (currentScene == 'Break - Music' || currentScene == 'Break - MTV') {
      for (i = full_volume; i > -100; i -= 1) {
        sendCommand('SetVolume', { volume: i, useDecibel: true, source: 'Lounge Music' });
        sendCommand('SetVolume', { volume: i, useDecibel: true, source: 'MTV' });
        await new Promise((r) => setTimeout(r, 20));
      }
      sendCommand('SetMute', { mute: false, source: 'BM800' });
    }

    if (newscene == 'Break - Music' || newscene == 'Break - MTV') {
      i = full_volume;
      sendCommand('SetVolume', { volume: i, useDecibel: true, source: 'Lounge Music' });
      sendCommand('SetVolume', { volume: i, useDecibel: true, source: 'MTV' });
      sendCommand('SetMute', { mute: true, source: 'BM800' });
    }

    sendCommand('SetCurrentScene', { 'scene-name': newscene });
  }

bilogic avatar May 05 '24 03:05 bilogic

All the volume control seems to gone SetVolume, SetMute seems to be gone

bilogic avatar May 05 '24 04:05 bilogic