mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 19:14:20 +01:00
Fix output report so microphone does not get muted.
Related to issue #20.
This commit is contained in:
parent
af2eb5805d
commit
907fed2f1d
@ -25,11 +25,11 @@ namespace DS4Windows.DS4Library
|
||||
}
|
||||
}
|
||||
|
||||
public DS4Audio()
|
||||
public DS4Audio(DataFlow audioFlags = DataFlow.Render)
|
||||
{
|
||||
var audioEnumerator = new MMDeviceEnumeratorComObject() as IMMDeviceEnumerator;
|
||||
IMMDeviceCollection audioDevices;
|
||||
audioEnumerator.EnumAudioEndpoints(DataFlow.Render, DeviceState.Active, out audioDevices);
|
||||
audioEnumerator.EnumAudioEndpoints(audioFlags, DeviceState.Active, out audioDevices);
|
||||
|
||||
int numAudioDevices;
|
||||
Marshal.ThrowExceptionForHR(audioDevices.GetCount(out numAudioDevices));
|
||||
|
@ -150,6 +150,7 @@ namespace DS4Windows
|
||||
private Thread ds4Input, ds4Output;
|
||||
private int battery;
|
||||
private DS4Audio audio = new DS4Audio();
|
||||
private DS4Audio micAudio = new DS4Audio(DS4Library.CoreAudio.DataFlow.Render);
|
||||
public DateTime lastActive = DateTime.UtcNow;
|
||||
public DateTime firstActive = DateTime.UtcNow;
|
||||
private bool charging;
|
||||
@ -803,6 +804,7 @@ namespace DS4Windows
|
||||
outputReportBuffer[9] = ledFlashOn; //flash on duration
|
||||
outputReportBuffer[10] = ledFlashOff; //flash off duration
|
||||
outputReportBuffer[19] = outputReportBuffer[20] = Convert.ToByte(audio.Volume);
|
||||
outputReportBuffer[21] = Convert.ToByte(micAudio.Volume);
|
||||
}
|
||||
|
||||
bool quitOutputThread = false;
|
||||
|
Loading…
Reference in New Issue
Block a user