The Swift Package Index logo.Swift Package Index

Build Information

Failed to build WWNormalizeAudioPlayer, reference 1.6.0 (11944e), with Swift 6.1 for macOS (SPM) on 28 Jul 2026 05:37:42 UTC.

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64

Build Log

========================================
RunAll
========================================
Builder version: undefined version: run 'make version' to update
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/William-Weng/WWNormalizeAudioPlayer.git
Reference: 1.6.0
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/William-Weng/WWNormalizeAudioPlayer
 * tag               1.6.0      -> FETCH_HEAD
HEAD is now at 11944e2 - 簡化播放功能 (去除Loop / Random) - 加強準備設定時,直接能取得音訊名及時間長度
Cloned https://github.com/William-Weng/WWNormalizeAudioPlayer.git
Revision (git rev-parse @):
11944e25e883b639c6a123118adca7947b63c2a3
SUCCESS checkout https://github.com/William-Weng/WWNormalizeAudioPlayer.git at 1.6.0
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/William-Weng/WWNormalizeAudioPlayer.git
https://github.com/William-Weng/WWNormalizeAudioPlayer.git
{
  "dependencies" : [
  ],
  "manifest_display_name" : "WWNormalizeAudioPlayer",
  "name" : "WWNormalizeAudioPlayer",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "17.0"
    }
  ],
  "products" : [
    {
      "name" : "WWNormalizeAudioPlayer",
      "targets" : [
        "WWNormalizeAudioPlayer"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "swift_languages_versions" : [
    "5"
  ],
  "targets" : [
    {
      "c99name" : "WWNormalizeAudioPlayer",
      "module_type" : "SwiftTarget",
      "name" : "WWNormalizeAudioPlayer",
      "path" : "Sources/WWNormalizeAudioPlayer",
      "product_memberships" : [
        "WWNormalizeAudioPlayer"
      ],
      "sources" : [
        "Tools/Equalizer.swift",
        "Tools/SpectrumAnalyzer.swift",
        "Utility/Constant.swift",
        "Utility/Extension.swift",
        "Utility/Model.swift",
        "Utility/Protocol.swift",
        "WWNormalizeAudioPlayer.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.10"
}
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-2F0A5646E1D333AE.txt
[3/10] Compiling WWNormalizeAudioPlayer Constant.swift
[4/10] Compiling WWNormalizeAudioPlayer Model.swift
error: emit-module command failed with exit code 1 (use -v to see invocation)
[5/10] Compiling WWNormalizeAudioPlayer Protocol.swift
[6/10] Compiling WWNormalizeAudioPlayer Extension.swift
[7/10] Compiling WWNormalizeAudioPlayer Equalizer.swift
[8/10] Compiling WWNormalizeAudioPlayer SpectrumAnalyzer.swift
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/Tools/SpectrumAnalyzer.swift:71:29: warning: capture of 'self' with non-sendable type 'WWNormalizeAudioPlayer.SpectrumAnalyzer' in a '@Sendable' closure
 13 |
 14 |     /// 這個分析器會使用 AVAudioNode 的 tap 擷取 PCM buffer,再透過 Accelerate / FFT 將時間域訊號轉成頻域資料,你可以用它來產生即時頻譜資料,進一步做視覺化、RMS、dB 轉換或自訂 band 分析
 15 |     final class SpectrumAnalyzer {
    |                 `- note: class 'SpectrumAnalyzer' does not conform to the 'Sendable' protocol
 16 |
 17 |         private let queue = DispatchQueue(label: "io.github.william-weng.WWNormalizeAudioPlayer.spectrum")  // 用來避免 FFT 分析阻塞主執行緒的背景 queue。
    :
 69 |
 70 |             self.queue.async {
 71 |                 let bands = self.analyzeRaw(buffer: buffer, sampleRate: sampleRate, minFrequency: minFrequency, maxFrequency: upper)
    |                             `- warning: capture of 'self' with non-sendable type 'WWNormalizeAudioPlayer.SpectrumAnalyzer' in a '@Sendable' closure
 72 |                 handler(bands)
 73 |             }
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/Tools/SpectrumAnalyzer.swift:71:53: warning: capture of 'buffer' with non-sendable type 'AVAudioPCMBuffer' in a '@Sendable' closure
 69 |
 70 |             self.queue.async {
 71 |                 let bands = self.analyzeRaw(buffer: buffer, sampleRate: sampleRate, minFrequency: minFrequency, maxFrequency: upper)
    |                                                     `- warning: capture of 'buffer' with non-sendable type 'AVAudioPCMBuffer' in a '@Sendable' closure
 72 |                 handler(bands)
 73 |             }
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioBuffer.h:67:12: note: class 'AVAudioPCMBuffer' does not conform to the 'Sendable' protocol
 65 | */
 66 | API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 67 | @interface AVAudioPCMBuffer : AVAudioBuffer
    |            `- note: class 'AVAudioPCMBuffer' does not conform to the 'Sendable' protocol
 68 |
 69 | /*!	@method initWithPCMFormat:frameCapacity:
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/Tools/SpectrumAnalyzer.swift:8:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'AVFAudio'
  6 | //
  7 |
  8 | import AVFAudio
    | `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'AVFAudio'
  9 | import Accelerate
 10 |
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/Tools/SpectrumAnalyzer.swift:72:17: warning: capture of 'handler' with non-sendable type 'WWNormalizeAudioPlayer.SpectrumRawBandsHandler' (aka '(Array<WWNormalizeAudioPlayer.SpectrumBandRaw>) -> ()') in a '@Sendable' closure
 70 |             self.queue.async {
 71 |                 let bands = self.analyzeRaw(buffer: buffer, sampleRate: sampleRate, minFrequency: minFrequency, maxFrequency: upper)
 72 |                 handler(bands)
    |                 |- warning: capture of 'handler' with non-sendable type 'WWNormalizeAudioPlayer.SpectrumRawBandsHandler' (aka '(Array<WWNormalizeAudioPlayer.SpectrumBandRaw>) -> ()') in a '@Sendable' closure
    |                 `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
 73 |             }
 74 |         }
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/Tools/SpectrumAnalyzer.swift:147:51: warning: cannot use inout expression here; argument 'realp' must be a pointer that outlives the call to 'init(realp:imagp:)'
145 |         var real = [Float](repeating: 0, count: halfSize)
146 |         var imag = [Float](repeating: 0, count: halfSize)
147 |         var splitComplex = DSPSplitComplex(realp: &real, imagp: &imag)
    |                                                   |- warning: cannot use inout expression here; argument 'realp' must be a pointer that outlives the call to 'init(realp:imagp:)'
    |                                                   |- note: implicit argument conversion from '[Float]' to 'UnsafeMutablePointer<Float>' produces a pointer valid only for the duration of the call to 'init(realp:imagp:)'
    |                                                   `- note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
148 |
149 |         samples.withUnsafeBufferPointer { pointer in
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/Tools/SpectrumAnalyzer.swift:147:65: warning: cannot use inout expression here; argument 'imagp' must be a pointer that outlives the call to 'init(realp:imagp:)'
145 |         var real = [Float](repeating: 0, count: halfSize)
146 |         var imag = [Float](repeating: 0, count: halfSize)
147 |         var splitComplex = DSPSplitComplex(realp: &real, imagp: &imag)
    |                                                                 |- warning: cannot use inout expression here; argument 'imagp' must be a pointer that outlives the call to 'init(realp:imagp:)'
    |                                                                 |- note: implicit argument conversion from '[Float]' to 'UnsafeMutablePointer<Float>' produces a pointer valid only for the duration of the call to 'init(realp:imagp:)'
    |                                                                 `- note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
148 |
149 |         samples.withUnsafeBufferPointer { pointer in
[9/10] Emitting module WWNormalizeAudioPlayer
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:19:42: error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 17 |
 18 |     private var audioURLs: [URL] = []
 19 |     private var preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5)
    |                                          `- error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 20 |     private var audioFile: AVAudioFile?
 21 |     private var audioEngine: AVAudioEngine?
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:19:62: error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 17 |
 18 |     private var audioURLs: [URL] = []
 19 |     private var preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5)
    |                                                              `- error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 20 |     private var audioFile: AVAudioFile?
 21 |     private var audioEngine: AVAudioEngine?
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:27:35: error: 'CADisplayLink' is only available in macOS 14.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 25 |     private var playbackState: PlaybackState = .idle
 26 |
 27 |     private weak var displayLink: CADisplayLink?
    |                                   `- error: 'CADisplayLink' is only available in macOS 14.0 or newer
 28 |
 29 |     public init() {}
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:82: error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 51 |
 52 | // MARK: - 公開函式
 53 | public extension WWNormalizeAudioPlayer {
    |        `- note: add @available attribute to enclosing extension
 54 |
 55 |     /// 設定代理與更新頻率,並初始化音訊引擎
    :
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |          |                                                                       `- error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
    |          `- note: add @available attribute to enclosing instance method
 63 |
 64 |         self.delegate = delegate
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:155: error: 'AVAudioSession' is unavailable in macOS
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |                                                                                                                                                           `- error: 'AVAudioSession' is unavailable in macOS
 63 |
 64 |         self.delegate = delegate
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:102: error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 51 |
 52 | // MARK: - 公開函式
 53 | public extension WWNormalizeAudioPlayer {
    |        `- note: add @available attribute to enclosing extension
 54 |
 55 |     /// 設定代理與更新頻率,並初始化音訊引擎
    :
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |          |                                                                                           `- error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
    |          `- note: add @available attribute to enclosing instance method
 63 |
 64 |         self.delegate = delegate
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:143:40: error: 'CADisplayLink' is only available in macOS 14.0 or newer
135 |
136 | // MARK: - @objc
137 | @objc private extension WWNormalizeAudioPlayer {
    |               `- note: add @available attribute to enclosing extension
138 |
139 |     /// 更新播放進度時間
    :
141 |     /// - Note: 此方法通常用於定期刷新目前播放時間並通知 delegate
142 |     @MainActor
143 |     func updatePlayTime(_ displayLink: CADisplayLink) {
    |          |                             `- error: 'CADisplayLink' is only available in macOS 14.0 or newer
    |          `- note: add @available attribute to enclosing instance method
144 |
145 |         do {
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:160:35: error: 'AVAudioSession' is unavailable in macOS
158 |     /// 初始化音樂引擎
159 |     /// - Parameter options: AVAudioSession.CategoryOptions
160 |     func initAudioEngine(options: AVAudioSession.CategoryOptions) throws {
    |                                   `- error: 'AVAudioSession' is unavailable in macOS
161 |
162 |         let audioSession = AVAudioSession.sharedInstance()
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
[10/10] Compiling WWNormalizeAudioPlayer WWNormalizeAudioPlayer.swift
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:19:42: error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 17 |
 18 |     private var audioURLs: [URL] = []
 19 |     private var preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5)
    |                                          `- error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 20 |     private var audioFile: AVAudioFile?
 21 |     private var audioEngine: AVAudioEngine?
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:19:62: error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 17 |
 18 |     private var audioURLs: [URL] = []
 19 |     private var preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5)
    |                                                              `- error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 20 |     private var audioFile: AVAudioFile?
 21 |     private var audioEngine: AVAudioEngine?
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:27:35: error: 'CADisplayLink' is only available in macOS 14.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 25 |     private var playbackState: PlaybackState = .idle
 26 |
 27 |     private weak var displayLink: CADisplayLink?
    |                                   `- error: 'CADisplayLink' is only available in macOS 14.0 or newer
 28 |
 29 |     public init() {}
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:82: error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 51 |
 52 | // MARK: - 公開函式
 53 | public extension WWNormalizeAudioPlayer {
    |        `- note: add @available attribute to enclosing extension
 54 |
 55 |     /// 設定代理與更新頻率,並初始化音訊引擎
    :
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |          |                                                                       `- error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
    |          `- note: add @available attribute to enclosing instance method
 63 |
 64 |         self.delegate = delegate
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:155: error: 'AVAudioSession' is unavailable in macOS
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |                                                                                                                                                           `- error: 'AVAudioSession' is unavailable in macOS
 63 |
 64 |         self.delegate = delegate
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:102: error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 51 |
 52 | // MARK: - 公開函式
 53 | public extension WWNormalizeAudioPlayer {
    |        `- note: add @available attribute to enclosing extension
 54 |
 55 |     /// 設定代理與更新頻率,並初始化音訊引擎
    :
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |          |                                                                                           `- error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
    |          `- note: add @available attribute to enclosing instance method
 63 |
 64 |         self.delegate = delegate
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:143:40: error: 'CADisplayLink' is only available in macOS 14.0 or newer
135 |
136 | // MARK: - @objc
137 | @objc private extension WWNormalizeAudioPlayer {
    |               `- note: add @available attribute to enclosing extension
138 |
139 |     /// 更新播放進度時間
    :
141 |     /// - Note: 此方法通常用於定期刷新目前播放時間並通知 delegate
142 |     @MainActor
143 |     func updatePlayTime(_ displayLink: CADisplayLink) {
    |          |                             `- error: 'CADisplayLink' is only available in macOS 14.0 or newer
    |          `- note: add @available attribute to enclosing instance method
144 |
145 |         do {
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:160:35: error: 'AVAudioSession' is unavailable in macOS
158 |     /// 初始化音樂引擎
159 |     /// - Parameter options: AVAudioSession.CategoryOptions
160 |     func initAudioEngine(options: AVAudioSession.CategoryOptions) throws {
    |                                   `- error: 'AVAudioSession' is unavailable in macOS
161 |
162 |         let audioSession = AVAudioSession.sharedInstance()
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:69:13: warning: no calls to throwing functions occur within 'try' expression
 67 |
 68 |         do {
 69 |             try delegate?.audioPlayer(self, prepare: getTrackInfos())
    |             `- warning: no calls to throwing functions occur within 'try' expression
 70 |             try initAudioEngine(options: options)
 71 |         } catch {
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:162:28: error: 'AVAudioSession' is unavailable in macOS
160 |     func initAudioEngine(options: AVAudioSession.CategoryOptions) throws {
161 |
162 |         let audioSession = AVAudioSession.sharedInstance()
    |                            `- error: 'AVAudioSession' is unavailable in macOS
163 |
164 |         do {
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:162:43: error: 'sharedInstance()' is unavailable in macOS
160 |     func initAudioEngine(options: AVAudioSession.CategoryOptions) throws {
161 |
162 |         let audioSession = AVAudioSession.sharedInstance()
    |                                           `- error: 'sharedInstance()' is unavailable in macOS
163 |
164 |         do {
AVFAudio.AVAudioSession.sharedInstance:3:19: note: 'sharedInstance()' has been explicitly marked unavailable here
1 | class AVAudioSession {
2 | @available(macOS, unavailable)
3 |   open class func sharedInstance() -> AVAudioSession}
  |                   `- note: 'sharedInstance()' has been explicitly marked unavailable here
4 |
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:165:30: error: 'setCategory(_:mode:options:)' is unavailable in macOS
163 |
164 |         do {
165 |             try audioSession.setCategory(.playback, mode: .default, options: options)
    |                              `- error: 'setCategory(_:mode:options:)' is unavailable in macOS
166 |             try audioSession.setActive(true)
167 |         } catch {
AVFAudio.AVAudioSession.setCategory:3:13: note: 'setCategory(_:mode:options:)' has been explicitly marked unavailable here
1 | class AVAudioSession {
2 | @available(macOS, unavailable)
3 |   open func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions = []) throws}
  |             `- note: 'setCategory(_:mode:options:)' has been explicitly marked unavailable here
4 |
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:165:43: error: 'playback' is unavailable in macOS
163 |
164 |         do {
165 |             try audioSession.setCategory(.playback, mode: .default, options: options)
    |                                           `- error: 'playback' is unavailable in macOS
166 |             try audioSession.setActive(true)
167 |         } catch {
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSessionTypes.h:100:40: note: 'playback' has been explicitly marked unavailable here
 98 |
 99 | /*! Use this category for music tracks.*/
100 | OS_EXPORT AVAudioSessionCategory const AVAudioSessionCategoryPlayback			API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
    |                                        `- note: 'playback' has been explicitly marked unavailable here
101 |
102 | /*! Use this category when recording audio. */
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:165:60: error: 'default' is unavailable in macOS
163 |
164 |         do {
165 |             try audioSession.setCategory(.playback, mode: .default, options: options)
    |                                                            `- error: 'default' is unavailable in macOS
166 |             try audioSession.setActive(true)
167 |         } catch {
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSessionTypes.h:136:36: note: 'default' has been explicitly marked unavailable here
134 |
135 | /*! The default mode */
136 | OS_EXPORT AVAudioSessionMode const AVAudioSessionModeDefault API_AVAILABLE(ios(5.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
    |                                    `- note: 'default' has been explicitly marked unavailable here
137 |
138 | /*! Only valid with AVAudioSessionCategoryPlayAndRecord.  Appropriate for Voice over IP
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:166:30: error: 'setActive' is unavailable in Swift
164 |         do {
165 |             try audioSession.setCategory(.playback, mode: .default, options: options)
166 |             try audioSession.setActive(true)
    |                              `- error: 'setActive' is unavailable in Swift
167 |         } catch {
168 |             throw CustomError.audioSessionConfigurationFailed
AVFAudio.AVAudioSession.setActive:4:13: note: 'setActive' has been explicitly marked unavailable here
2 | @available(macOS, unavailable)
3 |   @available(*, unavailable, message: "Not available in Swift")
4 |   open func setActive(_ active: Bool) throws}
  |             `- note: 'setActive' has been explicitly marked unavailable here
5 |
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:239:26: error: 'withCheckedContinuation(isolation:function:_:)' is only available in macOS 10.15 or newer
154 |
155 | // MARK: - 小工具
156 | private extension WWNormalizeAudioPlayer {
    |         `- note: add @available attribute to enclosing extension
157 |
158 |     /// 初始化音樂引擎
    :
235 |     ///   - `PlaybackError.playerNodeNotReady`:playerNode 尚未準備好
236 |     ///   - 其他由上層呼叫流程拋出的錯誤
237 |     func playAudioFile(audioFile: AVAudioFile, playerNode: AVAudioPlayerNode, callbackType: AVAudioPlayerNodeCompletionCallbackType = .dataPlayedBack) async throws -> AVAudioPlayerNodeCompletionCallbackType {
    |          `- note: add @available attribute to enclosing instance method
238 |
239 |         return try await withCheckedContinuation { continuation in
    |                          |- error: 'withCheckedContinuation(isolation:function:_:)' is only available in macOS 10.15 or newer
    |                          `- note: add 'if #available' version check
240 |
241 |             playerNode.scheduleFile(audioFile, at: nil, completionCallbackType: callbackType) { [weak self] type in
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:239:51: error: 'isolation()' is only available in macOS 10.15 or newer
`- /Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:239:50: note: expanded code originates here
154 |
155 | // MARK: - 小工具
156 | private extension WWNormalizeAudioPlayer {
    |         `- note: add @available attribute to enclosing extension
157 |
158 |     /// 初始化音樂引擎
    :
235 |     ///   - `PlaybackError.playerNodeNotReady`:playerNode 尚未準備好
236 |     ///   - 其他由上層呼叫流程拋出的錯誤
237 |     func playAudioFile(audioFile: AVAudioFile, playerNode: AVAudioPlayerNode, callbackType: AVAudioPlayerNodeCompletionCallbackType = .dataPlayedBack) async throws -> AVAudioPlayerNodeCompletionCallbackType {
    |          `- note: add @available attribute to enclosing instance method
238 |
239 |         return try await withCheckedContinuation { continuation in
    +--- /Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift
    |237 |
    |238 |
    |239 |                                                  #isolation
    |    |                                                   `- error: 'isolation()' is only available in macOS 10.15 or newer
    +-----------------------------------------------------------------------------------------------------------
240 |
241 |             playerNode.scheduleFile(audioFile, at: nil, completionCallbackType: callbackType) { [weak self] type in
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:241:103: warning: variable 'self' was written to, but never read
239 |         return try await withCheckedContinuation { continuation in
240 |
241 |             playerNode.scheduleFile(audioFile, at: nil, completionCallbackType: callbackType) { [weak self] type in
    |                                                                                                       `- warning: variable 'self' was written to, but never read
242 |                 continuation.resume(returning: type)
243 |             }
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:239:16: warning: no calls to throwing functions occur within 'try' expression
237 |     func playAudioFile(audioFile: AVAudioFile, playerNode: AVAudioPlayerNode, callbackType: AVAudioPlayerNodeCompletionCallbackType = .dataPlayedBack) async throws -> AVAudioPlayerNodeCompletionCallbackType {
238 |
239 |         return try await withCheckedContinuation { continuation in
    |                `- warning: no calls to throwing functions occur within 'try' expression
240 |
241 |             playerNode.scheduleFile(audioFile, at: nil, completionCallbackType: callbackType) { [weak self] type in
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:297:21: warning: instance will be immediately deallocated because property 'displayLink' is 'weak'
 25 |     private var playbackState: PlaybackState = .idle
 26 |
 27 |     private weak var displayLink: CADisplayLink?
    |                      `- note: 'displayLink' declared here
 28 |
 29 |     public init() {}
    :
295 |         stopTimer()
296 |
297 |         displayLink = CADisplayLink(target: self, selector: #selector(updatePlayTime(_:)))
    |                     |- warning: instance will be immediately deallocated because property 'displayLink' is 'weak'
    |                     `- note: a strong reference is required to prevent the instance from being deallocated
298 |         displayLink?.add(to: .main, forMode: .common)
299 |         displayLink?.preferredFrameRateRange = preferredFrameRateRange
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:297:23: error: 'CADisplayLink' is only available in macOS 14.0 or newer
154 |
155 | // MARK: - 小工具
156 | private extension WWNormalizeAudioPlayer {
    |         `- note: add @available attribute to enclosing extension
157 |
158 |     /// 初始化音樂引擎
    :
289 |
290 |     /// 開始計時
291 |     func startTimer() {
    |          `- note: add @available attribute to enclosing instance method
292 |
293 |         guard (delegate != nil) else { return }
    :
295 |         stopTimer()
296 |
297 |         displayLink = CADisplayLink(target: self, selector: #selector(updatePlayTime(_:)))
    |                       |- error: 'CADisplayLink' is only available in macOS 14.0 or newer
    |                       `- note: add 'if #available' version check
298 |         displayLink?.add(to: .main, forMode: .common)
299 |         displayLink?.preferredFrameRateRange = preferredFrameRateRange
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:297:23: error: 'init(target:selector:)' is unavailable in macOS
295 |         stopTimer()
296 |
297 |         displayLink = CADisplayLink(target: self, selector: #selector(updatePlayTime(_:)))
    |                       `- error: 'init(target:selector:)' is unavailable in macOS
298 |         displayLink?.add(to: .main, forMode: .common)
299 |         displayLink?.preferredFrameRateRange = preferredFrameRateRange
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h:32:1: note: 'init(target:selector:)' has been explicitly marked unavailable here
 30 |  * For macOS, see NSView/NSWindow/NSScreen.displayLink(withTarget:selector:). */
 31 |
 32 | + (CADisplayLink *)displayLinkWithTarget:(id)target selector:(SEL)sel
    | `- note: 'init(target:selector:)' has been explicitly marked unavailable here
 33 |     API_UNAVAILABLE(macos);
 34 |
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64
[0/1] Planning build
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
[2/9] Compiling WWNormalizeAudioPlayer Protocol.swift
[3/9] Compiling WWNormalizeAudioPlayer Extension.swift
[4/9] Compiling WWNormalizeAudioPlayer Model.swift
[5/9] Compiling WWNormalizeAudioPlayer Constant.swift
[6/9] Compiling WWNormalizeAudioPlayer WWNormalizeAudioPlayer.swift
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:19:42: error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 17 |
 18 |     private var audioURLs: [URL] = []
 19 |     private var preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5)
    |                                          `- error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 20 |     private var audioFile: AVAudioFile?
 21 |     private var audioEngine: AVAudioEngine?
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:19:62: error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 17 |
 18 |     private var audioURLs: [URL] = []
 19 |     private var preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5)
    |                                                              `- error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 20 |     private var audioFile: AVAudioFile?
 21 |     private var audioEngine: AVAudioEngine?
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:27:35: error: 'CADisplayLink' is only available in macOS 14.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 25 |     private var playbackState: PlaybackState = .idle
 26 |
 27 |     private weak var displayLink: CADisplayLink?
    |                                   `- error: 'CADisplayLink' is only available in macOS 14.0 or newer
 28 |
 29 |     public init() {}
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:82: error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 51 |
 52 | // MARK: - 公開函式
 53 | public extension WWNormalizeAudioPlayer {
    |        `- note: add @available attribute to enclosing extension
 54 |
 55 |     /// 設定代理與更新頻率,並初始化音訊引擎
    :
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |          |                                                                       `- error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
    |          `- note: add @available attribute to enclosing instance method
 63 |
 64 |         self.delegate = delegate
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:155: error: 'AVAudioSession' is unavailable in macOS
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |                                                                                                                                                           `- error: 'AVAudioSession' is unavailable in macOS
 63 |
 64 |         self.delegate = delegate
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:102: error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 51 |
 52 | // MARK: - 公開函式
 53 | public extension WWNormalizeAudioPlayer {
    |        `- note: add @available attribute to enclosing extension
 54 |
 55 |     /// 設定代理與更新頻率,並初始化音訊引擎
    :
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |          |                                                                                           `- error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
    |          `- note: add @available attribute to enclosing instance method
 63 |
 64 |         self.delegate = delegate
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:143:40: error: 'CADisplayLink' is only available in macOS 14.0 or newer
135 |
136 | // MARK: - @objc
137 | @objc private extension WWNormalizeAudioPlayer {
    |               `- note: add @available attribute to enclosing extension
138 |
139 |     /// 更新播放進度時間
    :
141 |     /// - Note: 此方法通常用於定期刷新目前播放時間並通知 delegate
142 |     @MainActor
143 |     func updatePlayTime(_ displayLink: CADisplayLink) {
    |          |                             `- error: 'CADisplayLink' is only available in macOS 14.0 or newer
    |          `- note: add @available attribute to enclosing instance method
144 |
145 |         do {
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:160:35: error: 'AVAudioSession' is unavailable in macOS
158 |     /// 初始化音樂引擎
159 |     /// - Parameter options: AVAudioSession.CategoryOptions
160 |     func initAudioEngine(options: AVAudioSession.CategoryOptions) throws {
    |                                   `- error: 'AVAudioSession' is unavailable in macOS
161 |
162 |         let audioSession = AVAudioSession.sharedInstance()
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:69:13: warning: no calls to throwing functions occur within 'try' expression
 67 |
 68 |         do {
 69 |             try delegate?.audioPlayer(self, prepare: getTrackInfos())
    |             `- warning: no calls to throwing functions occur within 'try' expression
 70 |             try initAudioEngine(options: options)
 71 |         } catch {
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:162:28: error: 'AVAudioSession' is unavailable in macOS
160 |     func initAudioEngine(options: AVAudioSession.CategoryOptions) throws {
161 |
162 |         let audioSession = AVAudioSession.sharedInstance()
    |                            `- error: 'AVAudioSession' is unavailable in macOS
163 |
164 |         do {
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:162:43: error: 'sharedInstance()' is unavailable in macOS
160 |     func initAudioEngine(options: AVAudioSession.CategoryOptions) throws {
161 |
162 |         let audioSession = AVAudioSession.sharedInstance()
    |                                           `- error: 'sharedInstance()' is unavailable in macOS
163 |
164 |         do {
AVFAudio.AVAudioSession.sharedInstance:3:19: note: 'sharedInstance()' has been explicitly marked unavailable here
1 | class AVAudioSession {
2 | @available(macOS, unavailable)
3 |   open class func sharedInstance() -> AVAudioSession}
  |                   `- note: 'sharedInstance()' has been explicitly marked unavailable here
4 |
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:165:30: error: 'setCategory(_:mode:options:)' is unavailable in macOS
163 |
164 |         do {
165 |             try audioSession.setCategory(.playback, mode: .default, options: options)
    |                              `- error: 'setCategory(_:mode:options:)' is unavailable in macOS
166 |             try audioSession.setActive(true)
167 |         } catch {
AVFAudio.AVAudioSession.setCategory:3:13: note: 'setCategory(_:mode:options:)' has been explicitly marked unavailable here
1 | class AVAudioSession {
2 | @available(macOS, unavailable)
3 |   open func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions = []) throws}
  |             `- note: 'setCategory(_:mode:options:)' has been explicitly marked unavailable here
4 |
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:165:43: error: 'playback' is unavailable in macOS
163 |
164 |         do {
165 |             try audioSession.setCategory(.playback, mode: .default, options: options)
    |                                           `- error: 'playback' is unavailable in macOS
166 |             try audioSession.setActive(true)
167 |         } catch {
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSessionTypes.h:100:40: note: 'playback' has been explicitly marked unavailable here
 98 |
 99 | /*! Use this category for music tracks.*/
100 | OS_EXPORT AVAudioSessionCategory const AVAudioSessionCategoryPlayback			API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
    |                                        `- note: 'playback' has been explicitly marked unavailable here
101 |
102 | /*! Use this category when recording audio. */
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:165:60: error: 'default' is unavailable in macOS
163 |
164 |         do {
165 |             try audioSession.setCategory(.playback, mode: .default, options: options)
    |                                                            `- error: 'default' is unavailable in macOS
166 |             try audioSession.setActive(true)
167 |         } catch {
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSessionTypes.h:136:36: note: 'default' has been explicitly marked unavailable here
134 |
135 | /*! The default mode */
136 | OS_EXPORT AVAudioSessionMode const AVAudioSessionModeDefault API_AVAILABLE(ios(5.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
    |                                    `- note: 'default' has been explicitly marked unavailable here
137 |
138 | /*! Only valid with AVAudioSessionCategoryPlayAndRecord.  Appropriate for Voice over IP
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:166:30: error: 'setActive' is unavailable in Swift
164 |         do {
165 |             try audioSession.setCategory(.playback, mode: .default, options: options)
166 |             try audioSession.setActive(true)
    |                              `- error: 'setActive' is unavailable in Swift
167 |         } catch {
168 |             throw CustomError.audioSessionConfigurationFailed
AVFAudio.AVAudioSession.setActive:4:13: note: 'setActive' has been explicitly marked unavailable here
2 | @available(macOS, unavailable)
3 |   @available(*, unavailable, message: "Not available in Swift")
4 |   open func setActive(_ active: Bool) throws}
  |             `- note: 'setActive' has been explicitly marked unavailable here
5 |
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:239:26: error: 'withCheckedContinuation(isolation:function:_:)' is only available in macOS 10.15 or newer
154 |
155 | // MARK: - 小工具
156 | private extension WWNormalizeAudioPlayer {
    |         `- note: add @available attribute to enclosing extension
157 |
158 |     /// 初始化音樂引擎
    :
235 |     ///   - `PlaybackError.playerNodeNotReady`:playerNode 尚未準備好
236 |     ///   - 其他由上層呼叫流程拋出的錯誤
237 |     func playAudioFile(audioFile: AVAudioFile, playerNode: AVAudioPlayerNode, callbackType: AVAudioPlayerNodeCompletionCallbackType = .dataPlayedBack) async throws -> AVAudioPlayerNodeCompletionCallbackType {
    |          `- note: add @available attribute to enclosing instance method
238 |
239 |         return try await withCheckedContinuation { continuation in
    |                          |- error: 'withCheckedContinuation(isolation:function:_:)' is only available in macOS 10.15 or newer
    |                          `- note: add 'if #available' version check
240 |
241 |             playerNode.scheduleFile(audioFile, at: nil, completionCallbackType: callbackType) { [weak self] type in
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:239:51: error: 'isolation()' is only available in macOS 10.15 or newer
`- /Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:239:50: note: expanded code originates here
154 |
155 | // MARK: - 小工具
156 | private extension WWNormalizeAudioPlayer {
    |         `- note: add @available attribute to enclosing extension
157 |
158 |     /// 初始化音樂引擎
    :
235 |     ///   - `PlaybackError.playerNodeNotReady`:playerNode 尚未準備好
236 |     ///   - 其他由上層呼叫流程拋出的錯誤
237 |     func playAudioFile(audioFile: AVAudioFile, playerNode: AVAudioPlayerNode, callbackType: AVAudioPlayerNodeCompletionCallbackType = .dataPlayedBack) async throws -> AVAudioPlayerNodeCompletionCallbackType {
    |          `- note: add @available attribute to enclosing instance method
238 |
239 |         return try await withCheckedContinuation { continuation in
    +--- /Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift
    |237 |
    |238 |
    |239 |                                                  #isolation
    |    |                                                   `- error: 'isolation()' is only available in macOS 10.15 or newer
    +-----------------------------------------------------------------------------------------------------------
240 |
241 |             playerNode.scheduleFile(audioFile, at: nil, completionCallbackType: callbackType) { [weak self] type in
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:241:103: warning: variable 'self' was written to, but never read
239 |         return try await withCheckedContinuation { continuation in
240 |
241 |             playerNode.scheduleFile(audioFile, at: nil, completionCallbackType: callbackType) { [weak self] type in
    |                                                                                                       `- warning: variable 'self' was written to, but never read
242 |                 continuation.resume(returning: type)
243 |             }
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:239:16: warning: no calls to throwing functions occur within 'try' expression
237 |     func playAudioFile(audioFile: AVAudioFile, playerNode: AVAudioPlayerNode, callbackType: AVAudioPlayerNodeCompletionCallbackType = .dataPlayedBack) async throws -> AVAudioPlayerNodeCompletionCallbackType {
238 |
239 |         return try await withCheckedContinuation { continuation in
    |                `- warning: no calls to throwing functions occur within 'try' expression
240 |
241 |             playerNode.scheduleFile(audioFile, at: nil, completionCallbackType: callbackType) { [weak self] type in
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:297:21: warning: instance will be immediately deallocated because property 'displayLink' is 'weak'
 25 |     private var playbackState: PlaybackState = .idle
 26 |
 27 |     private weak var displayLink: CADisplayLink?
    |                      `- note: 'displayLink' declared here
 28 |
 29 |     public init() {}
    :
295 |         stopTimer()
296 |
297 |         displayLink = CADisplayLink(target: self, selector: #selector(updatePlayTime(_:)))
    |                     |- warning: instance will be immediately deallocated because property 'displayLink' is 'weak'
    |                     `- note: a strong reference is required to prevent the instance from being deallocated
298 |         displayLink?.add(to: .main, forMode: .common)
299 |         displayLink?.preferredFrameRateRange = preferredFrameRateRange
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:297:23: error: 'CADisplayLink' is only available in macOS 14.0 or newer
154 |
155 | // MARK: - 小工具
156 | private extension WWNormalizeAudioPlayer {
    |         `- note: add @available attribute to enclosing extension
157 |
158 |     /// 初始化音樂引擎
    :
289 |
290 |     /// 開始計時
291 |     func startTimer() {
    |          `- note: add @available attribute to enclosing instance method
292 |
293 |         guard (delegate != nil) else { return }
    :
295 |         stopTimer()
296 |
297 |         displayLink = CADisplayLink(target: self, selector: #selector(updatePlayTime(_:)))
    |                       |- error: 'CADisplayLink' is only available in macOS 14.0 or newer
    |                       `- note: add 'if #available' version check
298 |         displayLink?.add(to: .main, forMode: .common)
299 |         displayLink?.preferredFrameRateRange = preferredFrameRateRange
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:297:23: error: 'init(target:selector:)' is unavailable in macOS
295 |         stopTimer()
296 |
297 |         displayLink = CADisplayLink(target: self, selector: #selector(updatePlayTime(_:)))
    |                       `- error: 'init(target:selector:)' is unavailable in macOS
298 |         displayLink?.add(to: .main, forMode: .common)
299 |         displayLink?.preferredFrameRateRange = preferredFrameRateRange
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h:32:1: note: 'init(target:selector:)' has been explicitly marked unavailable here
 30 |  * For macOS, see NSView/NSWindow/NSScreen.displayLink(withTarget:selector:). */
 31 |
 32 | + (CADisplayLink *)displayLinkWithTarget:(id)target selector:(SEL)sel
    | `- note: 'init(target:selector:)' has been explicitly marked unavailable here
 33 |     API_UNAVAILABLE(macos);
 34 |
[7/9] Compiling WWNormalizeAudioPlayer Equalizer.swift
error: emit-module command failed with exit code 1 (use -v to see invocation)
[8/9] Compiling WWNormalizeAudioPlayer SpectrumAnalyzer.swift
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/Tools/SpectrumAnalyzer.swift:147:51: warning: cannot use inout expression here; argument 'realp' must be a pointer that outlives the call to 'init(realp:imagp:)'
145 |         var real = [Float](repeating: 0, count: halfSize)
146 |         var imag = [Float](repeating: 0, count: halfSize)
147 |         var splitComplex = DSPSplitComplex(realp: &real, imagp: &imag)
    |                                                   |- warning: cannot use inout expression here; argument 'realp' must be a pointer that outlives the call to 'init(realp:imagp:)'
    |                                                   |- note: implicit argument conversion from '[Float]' to 'UnsafeMutablePointer<Float>' produces a pointer valid only for the duration of the call to 'init(realp:imagp:)'
    |                                                   `- note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
148 |
149 |         samples.withUnsafeBufferPointer { pointer in
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/Tools/SpectrumAnalyzer.swift:147:65: warning: cannot use inout expression here; argument 'imagp' must be a pointer that outlives the call to 'init(realp:imagp:)'
145 |         var real = [Float](repeating: 0, count: halfSize)
146 |         var imag = [Float](repeating: 0, count: halfSize)
147 |         var splitComplex = DSPSplitComplex(realp: &real, imagp: &imag)
    |                                                                 |- warning: cannot use inout expression here; argument 'imagp' must be a pointer that outlives the call to 'init(realp:imagp:)'
    |                                                                 |- note: implicit argument conversion from '[Float]' to 'UnsafeMutablePointer<Float>' produces a pointer valid only for the duration of the call to 'init(realp:imagp:)'
    |                                                                 `- note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
148 |
149 |         samples.withUnsafeBufferPointer { pointer in
[9/9] Emitting module WWNormalizeAudioPlayer
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:19:42: error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 17 |
 18 |     private var audioURLs: [URL] = []
 19 |     private var preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5)
    |                                          `- error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 20 |     private var audioFile: AVAudioFile?
 21 |     private var audioEngine: AVAudioEngine?
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:19:62: error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 17 |
 18 |     private var audioURLs: [URL] = []
 19 |     private var preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5)
    |                                                              `- error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 20 |     private var audioFile: AVAudioFile?
 21 |     private var audioEngine: AVAudioEngine?
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:27:35: error: 'CADisplayLink' is only available in macOS 14.0 or newer
 10 |
 11 | // MARK: - 音量正規化聲音播放器
 12 | open class WWNormalizeAudioPlayer {
    |            `- note: add @available attribute to enclosing class
 13 |
 14 |     public let equalizer: Equalizer = .init()
    :
 25 |     private var playbackState: PlaybackState = .idle
 26 |
 27 |     private weak var displayLink: CADisplayLink?
    |                                   `- error: 'CADisplayLink' is only available in macOS 14.0 or newer
 28 |
 29 |     public init() {}
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:82: error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
 51 |
 52 | // MARK: - 公開函式
 53 | public extension WWNormalizeAudioPlayer {
    |        `- note: add @available attribute to enclosing extension
 54 |
 55 |     /// 設定代理與更新頻率,並初始化音訊引擎
    :
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |          |                                                                       `- error: 'CAFrameRateRange' is only available in macOS 12.0 or newer
    |          `- note: add @available attribute to enclosing instance method
 63 |
 64 |         self.delegate = delegate
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:155: error: 'AVAudioSession' is unavailable in macOS
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |                                                                                                                                                           `- error: 'AVAudioSession' is unavailable in macOS
 63 |
 64 |         self.delegate = delegate
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:62:102: error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
 51 |
 52 | // MARK: - 公開函式
 53 | public extension WWNormalizeAudioPlayer {
    |        `- note: add @available attribute to enclosing extension
 54 |
 55 |     /// 設定代理與更新頻率,並初始化音訊引擎
    :
 60 |     /// - Throws: 當音訊會話或引擎初始化失敗時拋出錯誤
 61 |     @MainActor
 62 |     func prepare(audioURLs: [URL], delegate: Delegate?, preferredFrameRateRange: CAFrameRateRange = .init(minimum: 5, maximum: 5, preferred: 5), options: AVAudioSession.CategoryOptions = []) {
    |          |                                                                                           `- error: 'init(minimum:maximum:preferred:)' is only available in macOS 12.0 or newer
    |          `- note: add @available attribute to enclosing instance method
 63 |
 64 |         self.delegate = delegate
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:143:40: error: 'CADisplayLink' is only available in macOS 14.0 or newer
135 |
136 | // MARK: - @objc
137 | @objc private extension WWNormalizeAudioPlayer {
    |               `- note: add @available attribute to enclosing extension
138 |
139 |     /// 更新播放進度時間
    :
141 |     /// - Note: 此方法通常用於定期刷新目前播放時間並通知 delegate
142 |     @MainActor
143 |     func updatePlayTime(_ displayLink: CADisplayLink) {
    |          |                             `- error: 'CADisplayLink' is only available in macOS 14.0 or newer
    |          `- note: add @available attribute to enclosing instance method
144 |
145 |         do {
/Users/admin/builder/spi-builder-workspace/Sources/WWNormalizeAudioPlayer/WWNormalizeAudioPlayer.swift:160:35: error: 'AVAudioSession' is unavailable in macOS
158 |     /// 初始化音樂引擎
159 |     /// - Parameter options: AVAudioSession.CategoryOptions
160 |     func initAudioEngine(options: AVAudioSession.CategoryOptions) throws {
    |                                   `- error: 'AVAudioSession' is unavailable in macOS
161 |
162 |         let audioSession = AVAudioSession.sharedInstance()
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h:29:12: note: 'AVAudioSession' has been explicitly marked unavailable here
 27 | NS_SWIFT_SENDABLE
 28 | API_AVAILABLE(ios(3.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 29 | @interface AVAudioSession : NSObject {
    |            `- note: 'AVAudioSession' has been explicitly marked unavailable here
 30 | @private
 31 | 	void *_impl;
BUILD FAILURE 6.1 macosSpm