diff --git a/Sources/LiveKit/Extensions/AVAudioNode.swift b/Sources/LiveKit/Extensions/AVAudioNode.swift index b3b35d3d6..f42e0f09b 100644 --- a/Sources/LiveKit/Extensions/AVAudioNode.swift +++ b/Sources/LiveKit/Extensions/AVAudioNode.swift @@ -23,16 +23,13 @@ internal import LKObjCHelpers extension AVAudioNode { /// The underlying audio unit's `maximumFramesToRender`. /// - /// The Xcode 27 SDK restricts `auAudioUnit` to macOS 13.0 and deprecates it in favor of - /// `withAUAudioUnit`, so this prefers `withAUAudioUnit` on OS 27+, uses the `auAudioUnit` property - /// on macOS 13–26, and falls back to ``LKObjCHelpers`` (original ObjC availability, macOS 10.13) - /// below macOS 13. See #1035. + /// The macOS 27 SDK restricts `auAudioUnit` to macOS 13.0; below that it's reached through + /// ``LKObjCHelpers``, which keeps the property's original Objective-C availability (macOS 10.13). + /// See #1035. var maximumFramesToRender: AUAudioFrameCount { get { #if compiler(>=6.4) - if #available(macOS 27.0, iOS 27.0, tvOS 27.0, visionOS 27.0, *) { - return withAUAudioUnit { $0.maximumFramesToRender } - } else if #available(macOS 13.0, *) { + if #available(macOS 13.0, *) { return auAudioUnit.maximumFramesToRender } else { return LKObjCHelpers.maximumFramesToRender(for: self) @@ -43,9 +40,7 @@ extension AVAudioNode { } set { #if compiler(>=6.4) - if #available(macOS 27.0, iOS 27.0, tvOS 27.0, visionOS 27.0, *) { - withAUAudioUnit { $0.maximumFramesToRender = newValue } - } else if #available(macOS 13.0, *) { + if #available(macOS 13.0, *) { auAudioUnit.maximumFramesToRender = newValue } else { LKObjCHelpers.setMaximumFramesToRender(newValue, for: self)