The easiest way is that you already know the names of your sources. The following command will control a source. In this example the source name is "BLACK_BLACK", you are using decibels setting to -3 .
{"request-type":"SetVolume","message-id":"67","source":"BLACK_BLACK","volume":-3.0,"useDecibel":true}
-------------------------------------------------------------------------------------
from the manual
SetVolume
Set the volume of the specified source. Default request format uses mul, NOT SLIDER PERCENTAGE.
Request Fields:
Name | Type | Description |
---|
source | String | Source name. |
volume | double | Desired volume. Must be between 0.0 and 20.0 for mul, and under 26.0 for dB. OBS will interpret dB values under -100.0 as Inf. Note: The OBS volume sliders only reach a maximum of 1.0mul/0.0dB, however OBS actually supports larger values. |
useDecibel | boolean (optional) | Interperet volume data as decibels instead of amplitude/mul. |
------------------------------------------------------------------------------------------------
IF YOU WANT A LIST OF SOURCES, use this command
GetSourcesList
List all sources available in the running OBS instance
Request Fields:
No specified parameters.
Response Items:
Name | Type | Description |
---|
sources | Array<Object> | Array of sources |
sources.*.name | String | Unique source name |
sources.*.typeId | String | Non-unique source internal type (a.k.a kind) |
sources.*.type | String | Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" |
It's quite a bit of work to decode this
Hope that helps, Bill