网站图标 psd福州网站建设策划方案
2026/3/6 6:14:03 网站建设 项目流程
网站图标 psd,福州网站建设策划方案,导购网站 模板,随州网站建设多少钱转载请注明出处#xff1a;小锋学长生活大爆炸[xfxuezhagn.cn] 如果本文帮助到了你#xff0c;欢迎[点赞、收藏、关注]哦~ 以这个电脑音频频谱显示工具为例#xff1a;https://github.com/1061700625/SpectraTray 使用Swift 不需要Apple Develop ID#xff0c;推荐#x…转载请注明出处小锋学长生活大爆炸[xfxuezhagn.cn]如果本文帮助到了你欢迎[点赞、收藏、关注]哦~以这个电脑音频频谱显示工具为例https://github.com/1061700625/SpectraTray使用Swift不需要Apple Develop ID推荐原理是通过swift来做一个启动器。0、准备干净的环境。python -m venv tray source tray/bin/activate pip install -i https://pypi.org/simple pystray pillow numpy SoundCard pyobjc1、创建原生启动器 App。mkdir -p SpectraTray.app/Contents/{MacOS,Resources} mkdir -p SpectraTray.app/Contents/Resources/pysrc cp app.py SpectraTray.app/Contents/Resources/pysrc/ cp -R tray SpectraTray.app/Contents/Resources/tray cp SpectraTray.ico SpectraTray.app/Contents/Resources/2、写 Swift 启动器。cat main.swift SWIFT import Foundation import AVFoundation func runPython() { let bundleURL Bundle.main.bundleURL let py bundleURL.appendingPathComponent(Contents/Resources/tray/bin/python3).path let script bundleURL.appendingPathComponent(Contents/Resources/pysrc/app.py).path let task Process() task.executableURL URL(fileURLWithPath: py) task.arguments [script] // 完全后台不弹终端 task.standardOutput FileHandle.nullDevice task.standardError FileHandle.nullDevice do { try task.run() } catch { } exit(0) } // 先触发一次麦克风权限允许后 python 才能录到 BlackHole AVCaptureDevice.requestAccess(for: .audio) { _ in runPython() } RunLoop.main.run() SWIFT swiftc main.swift -o SpectraTray.app/Contents/MacOS/SpectraTray3、写 Info.plist。cat SpectraTray.app/Contents/Info.plist PLIST ?xml version1.0 encodingUTF-8? !DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd plist version1.0 dict keyCFBundleName/keystringSpectraTray/string keyCFBundleDisplayName/keystringSpectraTray/string keyCFBundleIdentifier/keystringlocal.spectratray/string keyCFBundleExecutable/keystringSpectraTray/string keyCFBundlePackageType/keystringAPPL/string keyCFBundleShortVersionString/keystring0.0.2/string keyCFBundleVersion/keystring1/string keyCFBundleIconFile/keystringSpectraTray.ico/string keyLSBackgroundOnly/keytrue/ keyNSMicrophoneUsageDescription/keystring用于捕获系统音频如 BlackHole并显示实时频谱/string keyLSApplicationCategoryType/keystringpublic.app-category.utilities/string /dict /plist PLIST4、去掉 quarantine。xattr -dr com.apple.quarantine SpectraTray.app5、刷新图标。touch SpectraTray.app6、启动 SpectraTray.app

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询