Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Sources/LiveKit/Extensions/AVAudioNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Loading