Skip to content

Commit 263366b

Browse files
committed
fixed some bugs
1 parent 1f80da3 commit 263366b

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

TestProject/Src/AudioLink/AudioLink.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,10 @@ private void SendAudioOutputData()
366366
// }
367367

368368
GetSamples();
369-
foreach (var b in _audioFramesL)
370-
{
371-
Logger.Log(b.ToString());
372-
}
369+
// foreach (var b in _audioFramesL)
370+
// {
371+
// Logger.Log(b.ToString());
372+
// }
373373
//Logger.Log("Volume: " + FriesBSCameraPlugin.AudioCapture.GetVolume());
374374

375375
Array.Copy(_audioFramesL, 0, _samples, 0, 1023); // 4092 - 1023 * 4

TestProject/Src/AudioLink/AudioLinkComponent.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ void Update()
2121
{
2222
_audioLink?.Tick();
2323
}
24+
25+
void OnDisable()
26+
{
27+
Logger.Close();
28+
}
2429
}

TestProject/Src/Logger.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@ public static void Log(string s)
3737
logStream?.Flush();
3838
}
3939

40+
public static void Close()
41+
{
42+
logStream?.Close();
43+
logStream = null;
44+
}
45+
4046
}

TestProject/Src/MyCameraPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public void OnDeactivate()
355355
beatSaberStatus.shutDown();
356356
_helper.behaviour.manager.camera.behaviour.mainCamera.cullingMask &= ~(1 << 9);
357357
Logger.Log("Camera Deactivate Done.");
358-
//Logger.Close();
358+
Logger.Close();
359359
}
360360

361361
// OnDestroy is called when the users selects a camera behaviour which is not a plugin or when the application is about to close.

0 commit comments

Comments
 (0)