sync capture type with preferences
This commit is contained in:
1 parent
8e06a0467a
commit
e78d9c9d48
13 files changed
+900
-971
No files matched your search
@@ -10,10 +10,18 @@ public class AudioSource : MonoBehaviour {
|
||||
public ScalingStrategy ScalingStrategy = ScalingStrategy.Sqrt;
|
||||
public WasapiAudioFilter[] Filters;
|
||||
|
||||
public Preferences preferences;
|
||||
|
||||
private WasapiAudio _wasapiAudio;
|
||||
private float[] _spectrumData;
|
||||
|
||||
public void Awake() {
|
||||
public void Start() {
|
||||
CaptureType = preferences.data.useLoopback
|
||||
? WasapiCaptureType.Loopback
|
||||
: WasapiCaptureType.Microphone;
|
||||
|
||||
Debug.Log($"Pref: {preferences.data.useLoopback} {CaptureType}");
|
||||
|
||||
Initialise();
|
||||
}
|
||||
|
||||
@@ -39,8 +47,10 @@ public class AudioSource : MonoBehaviour {
|
||||
public void ToggleCaptureType() {
|
||||
if (CaptureType == WasapiCaptureType.Loopback) {
|
||||
CaptureType = WasapiCaptureType.Microphone;
|
||||
preferences.SetUseLoopback(false);
|
||||
} else {
|
||||
CaptureType = WasapiCaptureType.Loopback;
|
||||
preferences.SetUseLoopback(true);
|
||||
}
|
||||
|
||||
Initialise();
|
||||
|
||||
Reference in new issue
Block a user