Latest0.2.0
Homepagehttps://github.com/jgorset/Recorder
LicenseMIT
Platformsios 8.0, requires ARC
Authors

[![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, [email protected]

License

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

Latest podspec

{
    "name": "Recorder",
    "version": "0.2.0",
    "summary": "Record and play audio",
    "description": "                       Record and play audio.n",
    "homepage": "https://github.com/jgorset/Recorder",
    "license": "MIT",
    "authors": {
        "Johannes Gorset": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jgorset/Recorder.git",
        "tag": "0.2.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "Recorder": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This