Skip to content

Commit

Permalink
Remove sampleRate update for iOS running on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCulbertson authored Oct 11, 2024
1 parent 6bff1a5 commit 7446acd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Cookbook/Cookbook/CookbookApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ struct CookbookApp: App {

// Settings.sampleRate default is 44_100
if #available(iOS 18.0, *) {
Settings.sampleRate = 48_000
if !ProcessInfo.processInfo.isMacCatalystApp && !ProcessInfo.processInfo.isiOSAppOnMac {
// iOS 18 app (not on Mac)
Settings.sampleRate = 48_000
}
}

try AVAudioSession.sharedInstance().setPreferredIOBufferDuration(Settings.bufferLength.duration)
Expand Down

0 comments on commit 7446acd

Please sign in to comment.