AKSettings

@objc open class AKSettings: NSObject

Global settings for AudioKit

  • Enum of available buffer lengths from Shortest: 2 power 5 samples (32 samples = 0.7 ms @ 44100 kz) to Longest: 2 power 12 samples (4096 samples = 92.9 ms @ 44100 Hz)

    See more

    Declaration

    Swift

    @objc public enum BufferLength: Int
  • The sample rate in Hertz

    Declaration

    Swift

    open static var sampleRate: Double = 44_100
  • Number of audio channels: 2 for stereo, 1 for mono

    Declaration

    Swift

    open static var numberOfChannels: UInt32 = 2
  • Whether we should be listening to audio input (microphone)

    Declaration

    Swift

    open static var audioInputEnabled: Bool = false
  • Whether to allow audio playback to override the mute setting

    Declaration

    Swift

    open static var playbackWhileMuted: Bool = false
  • Global audio format AudioKit will default to

    Declaration

    Swift

    open static var audioFormat: AVAudioFormat
  • Whether to DefaultToSpeaker when audio input is enabled

    Declaration

    Swift

    open static var defaultToSpeaker: Bool = false
  • Whether to use bluetooth when audio input is enabled

    Declaration

    Swift

    open static var useBluetooth: Bool = false
  • Undocumented

    Declaration

    Swift

    @objc open class AKSettings: NSObject
  • Global default rampTime value

    Declaration

    Swift

    open static var rampTime: Double = 0.000_2
  • Allows AudioKit to send Notifications

    Declaration

    Swift

    open static var notificationsEnabled: Bool = false
  • AudioKit buffer length is set using AKSettings.BufferLength default is .VeryLong for a buffer set to 2 power 10 = 1024 samples (232 ms)

    Declaration

    Swift

    open static var bufferLength: BufferLength = .veryLong
  • AudioKit recording buffer length is set using AKSettings.BufferLength default is .VeryLong for a buffer set to 2 power 10 = 1024 samples (232 ms) in Apple’s doc : The requested size of the incoming buffers. The implementation may choose another size. So setting this value may have no effect (depending on the hardware device ?)

    Declaration

    Swift

    open static var recordingBufferLength: BufferLength = .veryLong
  • If set to true, Recording will stop after some delay to compensate latency between time recording is stopped and time it is written to file If set to false (the default value) , stopping record will be immediate, even if the last audio frames haven’t been recorded to file yet.

    Declaration

    Swift

    open static var fixTruncatedRecordings = false
  • Enable AudioKit AVAudioSession Category Management

    Declaration

    Swift

    open static var disableAVAudioSessionCategoryManagement: Bool = false
  • Turn off AudioKit logging

    Declaration

    Swift

    open static var enableLogging: Bool = true
  • Shortcut for AVAudioSession.sharedInstance()

    Declaration

    Swift

    open static let session = AVAudioSession.sharedInstance()
  • Convenience method accessible from Objective-C

    Declaration

    Swift

    @objc open static func setSession(category: SessionCategory, options: UInt) throws
  • Set the audio session type

    Declaration

    Swift

    open static func setSession(category: SessionCategory,
                                    with options: AVAudioSessionCategoryOptions = [.mixWithOthers]) throws
  • Checks if headphones are plugged Returns true if headPhones are plugged, otherwise return false

    Declaration

    Swift

    static open var headPhonesPlugged: Bool
  • Enum of available AVAudioSession Categories

    See more

    Declaration

    Swift

    @objc public enum SessionCategory: Int, CustomStringConvertible