Add project files.

This commit is contained in:
Admin
2024-09-02 10:03:23 +07:00
parent 42def0d4aa
commit 6219298497
361 changed files with 58423 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace SafeBagDE70.Services
{
internal class WarningSoundManager2
{
private static bool _isWarningActive = false;
private static Thread _warningSoundThread;
public static void StartWarningSound()
{
if (!_isWarningActive)
{
_isWarningActive = true;
_warningSoundThread = new Thread(PlayWarningSound);
_warningSoundThread.IsBackground = true; // Ensure the thread stops when the application exits
_warningSoundThread.Start();
}
}
public static void StopWarningSound()
{
_isWarningActive = false;
}
private static void PlayWarningSound()
{
while (_isWarningActive)
{
Console.Beep(1200, 500); // Frequency: 1200 Hz, Duration: 500 ms
Thread.Sleep(500); // Pause for 500 ms before repeating for 100ms
}
}
}
}