diff --git a/Frameworks/libonnxruntime.dylib b/Frameworks/libonnxruntime.dylib new file mode 100644 index 0000000..ae6c5a3 Binary files /dev/null and b/Frameworks/libonnxruntime.dylib differ diff --git a/Frameworks/libsherpa-onnx-c-api.dylib b/Frameworks/libsherpa-onnx-c-api.dylib new file mode 100755 index 0000000..995edd4 Binary files /dev/null and b/Frameworks/libsherpa-onnx-c-api.dylib differ diff --git a/Info.plist b/Info.plist index 496a3f9..a2944e5 100644 --- a/Info.plist +++ b/Info.plist @@ -37,5 +37,16 @@ NSAllowsArbitraryLoads + CFBundleURLTypes + + + CFBundleURLName + com.soniox.voice + CFBundleURLSchemes + + soniox + + + diff --git a/resources/AppIcon.icns b/resources/AppIcon.icns new file mode 100644 index 0000000..76f3aa8 Binary files /dev/null and b/resources/AppIcon.icns differ diff --git a/src/AppDelegate.swift b/src/AppDelegate.swift index 0ad2967..b3640fa 100644 --- a/src/AppDelegate.swift +++ b/src/AppDelegate.swift @@ -409,6 +409,38 @@ public final class AppDelegate: NSObject, NSApplicationDelegate { } } + public func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { + print("AppDelegate: Application reopen triggered. Starting voice recording...") + DispatchQueue.main.async { [weak self] in + guard let self = self else { return } + if !self.audioRecorder.isRecording { + self.startRecording() + } + } + return false + } + + public func application(_ application: NSApplication, open urls: [URL]) { + for url in urls { + if url.scheme == "soniox" { + let action = url.host ?? url.path + if action.contains("start") { + DispatchQueue.main.async { [weak self] in + self?.startRecording() + } + } else if action.contains("stop") { + DispatchQueue.main.async { [weak self] in + self?.stopRecording() + } + } else if action.contains("toggle") { + DispatchQueue.main.async { [weak self] in + self?.toggleRecording() + } + } + } + } + } + public func applicationWillTerminate(_ notification: Notification) { HotkeyManager.shared.unregisterHotkeys() }