We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87109d4 commit fd5eacfCopy full SHA for fd5eacf
Cookbook/Cookbook/CookbookApp.swift
@@ -11,14 +11,13 @@ struct CookbookApp: App {
11
#if os(iOS)
12
do {
13
Settings.bufferLength = .short
14
-
+
15
let deviceSampleRate = AVAudioSession.sharedInstance().sampleRate
16
if deviceSampleRate > Settings.sampleRate {
17
// Update sampleRate to 48_000. Default is 44_100.
18
Settings.sampleRate = deviceSampleRate
19
}
20
21
22
try AVAudioSession.sharedInstance().setPreferredIOBufferDuration(Settings.bufferLength.duration)
23
try AVAudioSession.sharedInstance().setCategory(.playAndRecord,
24
options: [.defaultToSpeaker, .mixWithOthers, .allowBluetoothA2DP])
0 commit comments