GitXplorerGitXplorer
j

Recorder

public
37 stars
7 forks
2 issues

Commits

List of commits on branch master.
Unverified
89d3bb7ad6550bd470d44bd138dde2be06537757

Update podspec

vvadymmarkov committed 9 years ago
Unverified
e65eca690df59a8b3dbbcb77a942a9e083581718

Add playground

vvadymmarkov committed 9 years ago
Unverified
567108eb38ac05e31d09d0bf371d2bff341f2d21

Init shouldn't throw

vvadymmarkov committed 9 years ago
Unverified
61a4c37a1e1dbf917e49c1f6de544bae6bbf0480

Public prepare method

vvadymmarkov committed 9 years ago
Unverified
fba3a4d8d5c8523a8c2288bf5b92b7b4bfd9f677

Remove Mac scheme

vvadymmarkov committed 9 years ago
Unverified
c4ad471a0b76a3f0938e6159364e0ac7d384a65a

Support states in stop method

vvadymmarkov committed 9 years ago

README

The README file for this repository.

Recorder

[![CI Status](http://img.shields.io/travis/Johannes Gorset/Recorder.svg?style=flat)](https://travis-ci.org/Johannes Gorset/Recorder) Version Carthage Compatible License Platform

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)) {
      do {
        try self.recording.prepare()
      } catch {
        print(error)
      }
    }
  }

  func start() {
    do {
      try recording.record()
    } catch {
      print(error)
    }
  }

  func stop() {
    recording.stop()
  }

  func play() {
    do {
      try recording.play()
    } catch {
      print(error)
    }
  }
}

RecorderDelegate just extends AVAudioRecorderDelegate, so if you need to delegate things you can just implement those methods as you would normally do.

Metering

You can meter incoming audio levels by implementing audioMeterDidUpdate:

func audioMeterDidUpdate(db: Float) {
  print("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:

pod 'Recorder'

Recorder is also available through Carthage. To install just write into your Cartfile:

github "jgorset/Recorder"

Author

Johannes Gorset, jgorset@gmail.com

License

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