tweak some presets and fix the long running overflow error with spectre... maybe

This commit is contained in:
ntr committed 2022-06-20 17:46:45 +10:00
1 parent aa7062cf2a
commit 6cbf618624
16 files changed
+1375 -1079

No files matched your search

+23 -6
View File
@@ -50,14 +50,31 @@ public class AudioSource : MonoBehaviour {
}
public void ToggleCaptureType() {
bool isLoopback = CaptureType == WasapiCaptureType.Loopback;
if (isLoopback) {
CaptureType = WasapiCaptureType.Microphone;
preferences.SetUseLoopback(false);
if (CaptureType == WasapiCaptureType.Loopback) {
UseMicrophone();
} else {
CaptureType = WasapiCaptureType.Loopback;
preferences.SetUseLoopback(true);
UseLoopback();
}
}
void UseMicrophone() {
CaptureType = WasapiCaptureType.Microphone;
preferences.SetUseLoopback(false);
try {
Initialise();
} catch {
Debug.Log("Microphone unavailable");
// prevents the StopListen check from
// running on a half initialised object
_wasapiAudio = null;
UseLoopback();
}
}
void UseLoopback() {
CaptureType = WasapiCaptureType.Loopback;
preferences.SetUseLoopback(true);
Initialise();
}