Skip to content

Commit

Permalink
Only enumerate Render devices. Maybe support Capture devices later.
Browse files Browse the repository at this point in the history
  • Loading branch information
reinshope committed Jan 27, 2021
1 parent d142ebc commit 20132f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions GoXLRVolume/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ static void Main(string[] args)

MMDeviceEnumerator enumerator = new MMDeviceEnumerator();

var device = enumerator.EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active)
var device = enumerator.EnumerateAudioEndPoints(DataFlow.Render, DeviceState.Active)
.Where<MMDevice>(d => d.DeviceFriendlyName.Equals("TC-Helicon GoXLR"))
.FirstOrDefault<MMDevice>(i => i.FriendlyName.ToLower().StartsWith(deviceName));

if(device == null) errorAndTerminate("Could not find device match for input '" + deviceName + "'");

if (doTerminate) return;

Console.WriteLine("Setting {0} to volume {1}", device.FriendlyName, volumeInt / 100);
Console.WriteLine("Setting {0} to volume {1}%", device.FriendlyName, volumeInt);
device.AudioEndpointVolume.MasterVolumeLevelScalar = volumeInt / 100;

}
Expand Down
2 changes: 1 addition & 1 deletion GoXLRVolume/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"GoXLRVolume": {
"commandName": "Project",
"commandLineArgs": "hermam 75"
"commandLineArgs": "music 75"
}
}
}

0 comments on commit 20132f4

Please sign in to comment.