From 2afe50c037f3285912600dda4f3c93164c1b8752 Mon Sep 17 00:00:00 2001 From: NickCulbertson Date: Fri, 11 Oct 2024 09:04:38 -0400 Subject: [PATCH] Update CookbookApp.swift --- Cookbook/Cookbook/CookbookApp.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Cookbook/Cookbook/CookbookApp.swift b/Cookbook/Cookbook/CookbookApp.swift index 79899f4..907f331 100644 --- a/Cookbook/Cookbook/CookbookApp.swift +++ b/Cookbook/Cookbook/CookbookApp.swift @@ -12,10 +12,9 @@ struct CookbookApp: App { do { Settings.bufferLength = .short - let deviceSampleRate = AVAudioSession.sharedInstance().sampleRate - if deviceSampleRate > Settings.sampleRate { - // Update sampleRate to 48_000. Default is 44_100. - Settings.sampleRate = deviceSampleRate + // Settings.sampleRate default is 44_100 + if #available(iOS 18.0, *) { + Settings.sampleRate = 48_000 } try AVAudioSession.sharedInstance().setPreferredIOBufferDuration(Settings.bufferLength.duration)