Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetVolume not properly setting volume #301

Open
VideoGameRoulette opened this issue Aug 23, 2022 · 1 comment
Open

SetVolume not properly setting volume #301

VideoGameRoulette opened this issue Aug 23, 2022 · 1 comment

Comments

@VideoGameRoulette
Copy link

Description:

SetVolume event always maxes out any audio input I attempt to modify the value for regardless of values being sent it always seems to max the selected volume. This happens even with useDecibel option as well.

Steps

  • Build Slider Input
  • min -101
  • max 26
  • use slider to select volume
  • send SetVolume call thru socket with source name and value from slider
  • audio is instantly maxed out for the given source regardless of number sent from -101 to 26

Versions Used:

  • obs-websocket-js version: 4.0.3
  • obs-websocket plugin version: 4.9.1
  • obs-studio version: 27.2.3
  • node version: 16.13.1
<label for="volume" className="block text-sm font-medium text-white">{feed?.name}: {feed?.volume}</label>
<input
    min={-101.0}
    max={26.0}
    step={0.1}
    id="volume"
    name="volume"
    type="range"
    className="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
    defaultValue={feed?.volume}
    onMouseUp={e => SetVolume(feed, e)}
/>
SetVolume = (src, e) => {
    const { name } = src;
    console.log("Volume Changed To:" e.target.value);
    this.obs.socket.send('SetVolume', {
      source: name,
      volume: e.target.value,
    });
  }

log
Volume Changed To: 0.1

@MuhammedOzby
Copy link

This is using V5.0.2:

Get input:

const inputs = await OBS.call("GetSpecialInputs");

Set input volume:

OBS.call("SetInputVolume", {
  inputName: data[0],
  inputVolumeDb: typeof val == "number" ? val : val[0],
});

And, i am using only integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants