Recorder 0.2.0

Recorder 0.2.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2015
SPMSupports SPM

Maintained by Johannes Gorset.



Recorder 0.2.0

  • By
  • Johannes Gorset

Usage

import UIKit
import Recorder

class ViewController: UIViewController, RecorderDelegate {
    var recording: Recording!

    override func viewDidLoad()
    {
        super.viewDidLoad()

        recording = Recording(to: "recording.m4a")
        recording.delegate = self

        // Optionally, you can prepare the recording in the background to
        // make it start recording faster when you hit `record()`.
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
            recording.prepare()
        }
    }

    func start()
    {
        recording.record()
    }

    func stop()
    {
        recording.stop()
    }

    func play()
    {
        recording.play()
    }

}

Metering

You can meter incoming audio levels by implementing audioMeterDidUpdate:

func audioMeterDidUpdate(db: Float)
{
    NSLog("db level: %f", db)
}

Configuration

The following configurations may be made to the Recording instance:

  • bitRate (default 192000)
  • sampleRate (default 41000.0)
  • channels (default 1)

Requirements

  • Balls of steel (it's my first pod, and it's really bad)

Installation

Recorder is available through CocoaPods. To install it, simply add the following line to your Podfile:

use_frameworks!
pod "Recorder"

Author

Johannes Gorset, [email protected]

License

Recorder is available under the MIT license. See the LICENSE file for more info.