Closed vycoder closed 6 months ago
Try out the Cookbook Oscillator example and see if it is giving you the same issue. https://github.com/AudioKit/Cookbook
My guess is that you need to set the AVAudioSession category in your main app file like this:
init() {
#if os(iOS)
do {
Settings.bufferLength = .medium
try AVAudioSession.sharedInstance().setPreferredIOBufferDuration(Settings.bufferLength.duration)
try AVAudioSession.sharedInstance().setCategory(.playback,
options: [.mixWithOthers, .allowBluetoothA2DP])
try AVAudioSession.sharedInstance().setActive(true)
} catch let err {
print(err)
}
#endif
}
That worked really well! Closing this issue. Thanks for the help! Is the Cookbook the official place where to find all the necessary information regarding AudioKit? I'm very new to all of this, and I'm having trouble navigating the documentation. I don't even know how to run the Cookbook, any suggestions on where absolute beginners like me should start?
The Cookbook showcases most of the various pieces of AudioKit and how to implement them. I started learning AudioKit with the Cookbook. You can download the project from GitHub and run it like any other Xcode project (unless you’re getting some weird compiler errors). You can also find some tutorials on YouTube that should help in going up the AudioKit learning curve.On May 4, 2024, at 11:11 PM, yev @.***> wrote: That worked really well! Closing this issue. Thanks for the help! Is the Cookbook the official place where to find all the necessary information regarding AudioKit? I'm very new to all of this, and I'm having trouble navigating the documentation. I don't even know how to run the Cookbook, any suggestions on where absolute beginners like me should start?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
macOS Version(s) Used to Build
macOS 13 Ventura
Xcode Version(s)
Xcode 14
Description
I've tried writing a very simple Oscillator that just plays a certain frequency. It's working on the emulator but once I deployed it to a my iPhone (12 mini, iOS version 17.4.1) it just plays for a short while but then stops (about 1 second). I've tried checking whether the Oscillator really started using
isStarted
but it prints outtrue
.Is there any configuration settings that I need to setup beforehand? I'm fairly new to AudioKit (and swift in general), was hoping someone can point me in the right direction. Here's my code:
I'm running this using an M2 Macbook Air, MacOs Sonoma 14.4.1
Crash Logs, Screenshots or Other Attachments (if applicable)
No response