Skip to content

Commit

Permalink
changed to getting only active audio device
Browse files Browse the repository at this point in the history
  • Loading branch information
Maqentaer committed May 1, 2020
1 parent 205565f commit 0d8591d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SWYH/Audio/WasapiProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ public WasapiProvider()
string captureDeviceID = SWYH.Properties.Settings.Default.AudioDevice;
if (captureDeviceID != "")
{
try
foreach (var wasapi in enumerator.EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active))
{
captureDevice = enumerator.GetDevice(captureDeviceID);
if (wasapi.ID == captureDeviceID)
{
captureDevice = wasapi;
}
}
catch { }
}
if (captureDevice == null)
{
Expand Down

0 comments on commit 0d8591d

Please sign in to comment.