Skip to content

Commit

Permalink
Update CookbookApp.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCulbertson committed Oct 11, 2024
1 parent 7a14910 commit 2afe50c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Cookbook/Cookbook/CookbookApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2afe50c

Please sign in to comment.