|
|
@ -112,8 +112,19 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private func playSystemSound(name: String) { |
|
|
private func playSystemSound(name: String) { |
|
|
if SonioxSettings.shared.playSounds { |
|
|
|
|
|
NSSound(named: NSSound.Name(name))?.play() |
|
|
|
|
|
|
|
|
guard SonioxSettings.shared.playSounds else { return } |
|
|
|
|
|
DispatchQueue.main.async { |
|
|
|
|
|
if let sound = NSSound(named: NSSound.Name(name)) { |
|
|
|
|
|
sound.volume = 1.0 |
|
|
|
|
|
sound.play() |
|
|
|
|
|
} else { |
|
|
|
|
|
DispatchQueue.global(qos: .userInitiated).async { |
|
|
|
|
|
let p = Process() |
|
|
|
|
|
p.executableURL = URL(fileURLWithPath: "/usr/bin/afplay") |
|
|
|
|
|
p.arguments = ["/System/Library/Sounds/\(name).aiff"] |
|
|
|
|
|
try? p.run() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -193,7 +204,7 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { |
|
|
|
|
|
|
|
|
do { |
|
|
do { |
|
|
try audioRecorder.startRecording() |
|
|
try audioRecorder.startRecording() |
|
|
playSystemSound(name: "Tink") |
|
|
|
|
|
|
|
|
playSystemSound(name: "Hero") |
|
|
statusBarController.updateIcon(state: .recording) |
|
|
statusBarController.updateIcon(state: .recording) |
|
|
statusBarController.buildMenu(isRecording: true) |
|
|
statusBarController.buildMenu(isRecording: true) |
|
|
HUDOverlayController.shared.show(state: .recording(level: 0.1, isLagging: false, pingQuality: PingMonitor.shared.currentQuality)) |
|
|
HUDOverlayController.shared.show(state: .recording(level: 0.1, isLagging: false, pingQuality: PingMonitor.shared.currentQuality)) |
|
|
|