Jaggernaut555

MidiMixer OBS plugin Audio Monitor

Aug 1st, 2021
2,016
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Line 87 of index.ts on the obs plugin
  2. // get audio monitor filters
  3. obs.send("GetSourceFilters", {sourceName: source.name}).then((filterData) => {
  4.     let amFilters: any[] = filterData.filters.filter((f:any) => f.type == "audio_monitor");
  5.     amFilters.forEach((f) => {
  6.         let name = source.name + ": " + f.name;
  7.         const filterAssignment = new Assignment(name, {
  8.         name: name,
  9.         muted,
  10.         volume: (f.settings.volume / 100) // it uses 0-100
  11.         })
  12.         filterAssignment.on("volumeChanged", (level: number) => {
  13.         obs.send("SetSourceFilterSettings", {
  14.             sourceName: source.name,
  15.             filterName: f.name,
  16.             filterSettings: {
  17.             volume: (level * 100),
  18.             }
  19.         });
  20.         });
  21.     })
  22. })
RAW Paste Data