Latest 1.0.1
Homepage https://github.com/quanghoang0101/HPRecorder
License MIT
Platforms ios 10.0
Authors

Platform
Language
Version
License
Issues
Build
codecov

A recorder audio for iOS, simple to integrate, calculated percent of loudness.

sample

Installation

CocoaPods

pod 'HPRecorder'

Manually

Copy the HPRecorder folder to your project.

Conguration

// Time interval to get percent of loudness
open var timeInterVal: TimeInterval = 0.3
// File name of audio
open var audioFilename: URL!
// Audio input: default speaker, bluetooth
open var audioInput: AVAudioSessionPortDescription!

Monitor recorder

// Recorder did finish
open var recorderDidFinish: ((_ recocorder: AVAudioRecorder, _ url: URL, _  success: Bool) -> Void)?
// Recorder occur error
open var recorderOccurError: ((_ recocorder: AVAudioRecorder, _ error: Error) -> Void)?
// Percent of loudness
open var percentLoudness: ((_ percent: Float) -> Void)?

Actions

// Ask permssion to record audio
public func askPermission(completion: ((_ allowed: Bool) -> Void)?)
// Start recording
public func startRecording()
// End recording
public func endRecording()
// Pause recorinding
public func pauseRecording()
// Resume recording
public func resumeRecording()

Usage

Setup

Add import HPRecorder in your file

In Info.plist file of project, you MUST add Privacy - Microphone Usage Description key to can use microphone permission.

Requirements

Swift 5.0

iOS 10.0+

Xcode 10.2+

Contributing

Forks, patches and other feedback are welcome.

Creator

Quang Hoang

Blog

License

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

Latest podspec

{
    "name": "HPRecorder",
    "version": "1.0.1",
    "summary": "A recorder audio for iOS",
    "description": "A recorder audio for iOS, simple to integrate, calculated percent of loudness",
    "homepage": "https://github.com/quanghoang0101/HPRecorder",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Hoang": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/quanghoang0101/HPRecorder.git",
        "tag": "1.0.1"
    },
    "source_files": "HPRecorder/**/*.{swift}",
    "swift_version": "5"
}

Pin It on Pinterest

Share This