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
  • Constants for ramps used in AKParameterRamp.hpp, AKBooster, and others

    See more

    Declaration

    Swift

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

    Declaration

    Swift

    @objc
    public static var sampleRate: Double { get set }
  • Number of audio channels: 2 for stereo, 1 for mono

    Declaration

    Swift

    @objc
    public static var channelCount: UInt32
  • Whether we should be listening to audio input (microphone)

    Declaration

    Swift

    @objc
    public static var audioInputEnabled: Bool
  • Whether to allow audio playback to override the mute setting

    Declaration

    Swift

    @objc
    public static var playbackWhileMuted: Bool
  • Global audio format AudioKit will default to

    Declaration

    Swift

    @objc
    public static var audioFormat: AVAudioFormat { get }
  • Whether to output to the speaker (rather than receiver) when audio input is enabled

    Declaration

    Swift

    @objc
    public static var defaultToSpeaker: Bool
  • Whether to use bluetooth when audio input is enabled

    Declaration

    Swift

    @objc
    public static var useBluetooth: Bool
  • Additional control over the options to use for bluetooth

    Declaration

    Swift

    @objc
    public static var bluetoothOptions: AVAudioSessionCategoryOptions
  • Whether AirPlay is enabled when audio input is enabled

    Declaration

    Swift

    @objc
    public static var allowAirPlay: Bool
  • Global default rampDuration value

    Declaration

    Swift

    @objc
    public static var rampDuration: Double
  • Allows AudioKit to send Notifications

    Declaration

    Swift

    @objc
    public static var notificationsEnabled: Bool
  • 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

    @objc
    public static var bufferLength: AKSettings.BufferLength
  • The hardware ioBufferDuration. Setting this will request the new value, getting will query the hardware.

  • The hardware ioBufferDuration. Setting this will request the new value, getting will query the hardware.

    Declaration

    Swift

    @objc
    public static var ioBufferDuration: Double { get set }
  • 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

    @objc
    public static var recordingBufferLength: AKSettings.BufferLength
  • 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

    @objc
    public static var fixTruncatedRecordings: Bool
  • Enable AudioKit AVAudioSession Category Management

    Declaration

    Swift

    @objc
    public static var disableAVAudioSessionCategoryManagement: Bool
  • If set to true, AudioKit will not deactivate the AVAudioSession when stopping

    Declaration

    Swift

    @objc
    public static var disableAudioSessionDeactivationOnStop: Bool
  • If set to false, AudioKit will not handle the AVAudioSession route change notification (AVAudioSessionRouteChange) and will not restart the AVAudioEngine instance when such notifications are posted. The developer can instead subscribe to these notifications and restart AudioKit after rebuiling their audio chain.

    Declaration

    Swift

    @objc
    public static var enableRouteChangeHandling: Bool
  • If set to false, AudioKit will not handle the AVAudioSession category change notification (AVAudioEngineConfigurationChange) and will not restart the AVAudioEngine instance when such notifications are posted. The developer can instead subscribe to these notifications and restart AudioKit after rebuiling their audio chain.

    Declaration

    Swift

    @objc
    public static var enableCategoryChangeHandling: Bool
  • Turn off AudioKit logging

    Declaration

    Swift

    @objc
    public static var enableLogging: Bool
  • Checks the application’s info.plist to see if UIBackgroundModes includes audio. If background audio is supported then the system will allow the AVAudioEngine to start even if the app is in, or entering, a background state. This can help prevent a potential crash (AVAudioSessionErrorCodeCannotStartPlaying aka error code 561015905) when a route/category change causes AudioEngine to attempt to start while the app is not active and background audio is not supported.

    Declaration

    Swift

    @objc
    public static let appSupportsBackgroundAudio: Bool
  • Shortcut for AVAudioSession.sharedInstance()

    Declaration

    Swift

    @objc
    public static let session: AVAudioSession
  • Convenience method accessible from Objective-C

    Declaration

    Swift

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

    Declaration

    Swift

    @objc
    public static func setSession(category: SessionCategory,
                                  with options: AVAudioSessionCategoryOptions = []) throws
  • Declaration

    Swift

    @objc
    public static func computedSessionCategory() -> SessionCategory
  • Declaration

    Swift

    @objc
    public static func computedSessionOptions() -> AVAudioSessionCategoryOptions
  • Checks if headphones are connected Returns true if headPhones are connected, otherwise return false

    Declaration

    Swift

    @objc
    public static var headPhonesPlugged: Bool { get }
  • Enum of available AVAudioSession Categories

    See more

    Declaration

    Swift

    @objc
    public enum SessionCategory : Int, CustomStringConvertible