AKConverter

open class AKConverter : NSObject

AKConverter wraps the more complex AVFoundation and CoreAudio audio conversions in an easy to use format.

let options = AKConverter.Options()
// any options left nil will assume the value of the input file
options.format = "wav"
options.sampleRate == 48000
options.bitDepth = 24

let converter = AKConverter(inputURL: oldURL, outputURL: newURL, options: options)
converter.start(completionHandler: { error in
// check to see if error isn't nil, otherwise you're good
})
  • AKConverterCallback is the callback format for start() -Parameter: error This will contain one parameter of type Error which is nil if the conversion was successful.

    Declaration

    Swift

    public typealias AKConverterCallback = (_ error: Error?) -> Void
  • Formats that this class can write

    Declaration

    Swift

    open static let outputFormats: [String]
  • Formats that this class can read

    Declaration

    Swift

    open static let inputFormats: [String]
  • The conversion options, leave nil to adopt the value of the input file

    See more

    Declaration

    Swift

    public struct Options
  • Declaration

    Swift

    open var inputURL: URL?
  • Declaration

    Swift

    open var outputURL: URL?
  • Declaration

    Swift

    open var options: AKConverter.Options?
  • The entry point for file conversion

    Declaration

    Swift

    open func start(completionHandler: AKConverterCallback? = nil)

    Parameters

    completionHandler

    the callback that will be triggered when process has completed.