GitXplorerGitXplorer
j

Recorder

public
37 stars
7 forks
2 issues

Commits

List of commits on branch master.
Unverified
90fabc6c033b0c77b2c24876b28f9cf20120ac1c

Merge pull request #2 from vadymmarkov/refactor/framework

jjgorset committed 9 years ago
Unverified
8b315ee035c006d0783eec150ac6edc68a114e7e

Improve .gitignore

vvadymmarkov committed 9 years ago
Unverified
ada0e367057e2df7cbe7ca6918947bd84072a731

Remove example

vvadymmarkov committed 9 years ago
Unverified
6eb382f0d805d95bda3c33627debf66ec7980e1e

Add carthage description

vvadymmarkov committed 9 years ago
Unverified
b8142fbf9906f2e6758491f3bbe83865d199c909

Make bitrate, samplerate and channels public

vvadymmarkov committed 9 years ago
Unverified
bfc525bc9e005e1a2686c3b3989f00270509559f

Update readme

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.