diff --git a/Source/Modules/SFX/clsSFX.swift b/Source/Modules/SFX/clsSFX.swift index 6a6b4e04..d3b211fa 100644 --- a/Source/Modules/SFX/clsSFX.swift +++ b/Source/Modules/SFX/clsSFX.swift @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import AVFoundation import Foundation -public class clsSFX { +public enum clsSFX { static func beep() { let filePath = Bundle.main.path(forResource: mgrPrefs.shouldNotFartInLieuOfBeep ? "Beep" : "Fart", ofType: "m4a")! let fileURL = URL(fileURLWithPath: filePath) @@ -33,4 +33,15 @@ public class clsSFX { AudioServicesCreateSystemSoundID(fileURL as CFURL, &soundID) AudioServicesPlaySystemSound(soundID) } + + static func beep(count: Int = 1) { + if count <= 1 { + clsSFX.beep() + return + } + for _ in 0...count { + clsSFX.beep() + usleep(500_000) + } + } }