https://github.com/quanghoang0101/hprecorder
A recorder audio for iOS, simple to integrate, calculated percent of loudness
https://github.com/quanghoang0101/hprecorder
audio audio-recorder ios ios-app ios-swift percent record recorder ui
Last synced: about 2 months ago
JSON representation
A recorder audio for iOS, simple to integrate, calculated percent of loudness
- Host: GitHub
- URL: https://github.com/quanghoang0101/hprecorder
- Owner: quanghoang0101
- License: mit
- Created: 2019-05-07T16:10:21.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-08T08:05:35.000Z (about 6 years ago)
- Last Synced: 2025-03-28T22:45:50.642Z (about 2 months ago)
- Topics: audio, audio-recorder, ios, ios-app, ios-swift, percent, record, recorder, ui
- Language: Swift
- Homepage:
- Size: 38.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HPRecorder
[](https://developer.apple.com/iphone/index.action)
[](https://developer.apple.com/swift)
[](https://cocoapods.org/pods/HPRecorder)
[](http://mit-license.org)
[](https://github.com/quanghoang0101/HPRecorder/issues?state=open)

[](https://codecov.io/gh/quanghoang0101/HPRecorder)A recorder audio for iOS, simple to integrate, calculated percent of loudness.

# Installation
#### CocoaPods
```
pod 'HPRecorder'
```
#### Manually
Copy the `HPRecorder` folder to your project.## Conguration
```Swift
// 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
```Swift
// 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
```Swift
// 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 fileIn `Info.plist` file of project, you MUST add `Privacy - Microphone Usage Description` key to can use microphone permission.
## Requirements
Swift 5.0iOS 10.0+
Xcode 10.2+
## Contributing
Forks, patches and other feedback are welcome.## Creator
[Quang Hoang](https://github.com/quanghoang0101)[Blog](https://medium.com/@phanquanghoang)
## License
HPRecorder is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.