Giter Site home page Giter Site logo

mohsinalimat / amraudioswift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teambition/amraudioswift

1.0 3.0 0.0 3.89 MB

A useful tool to encode or decode audio between AMR and WAVE.

License: MIT License

Swift 59.46% Objective-C 38.28% C 2.26%

amraudioswift's Introduction

AMRAudioSwift

AMRAudioSwift is a useful tool to encode or decode audio between AMR and WAVE. It's written in Swift, and it supports Bitcode.

In addition, AMRAudioSwift contains an audio recorder/player, which can record voice and play AMR data.

At the bottom level, libopencore-amr is applied for audio decoding.

How To Get Started

Carthage

Specify "AMRAudioSwift" in your Cartfile:

github "teambition/AMRAudioSwift"

Usage

Configuration

let audioRecorder = AMRAudioRecorder()
audioRecorder.volume = ...
audioRecorder.isProximityMonitoringEnabled = ...
audioRecorder.isScreenBrightWhenPlaying = ...

// assign delegate
audioRecorder.delegate = self

Recording and Playing

audioRecorder.startRecord()
audioRecorder.cancelRecord()
audioRecorder.stopRecord()
audioRecorder.play(waveData)
audioRecorder.playAmr(amrData)
audioRecorder.stopPlay()

Implement delegate

func audioRecorderDidStartRecording(_ audioRecorder: AMRAudioRecorder) {
    // do something
}

func audioRecorderDidCancelRecording(_ audioRecorder: AMRAudioRecorder) {
    // do something
}

func audioRecorderDidStopRecording(_ audioRecorder: AMRAudioRecorder, withURL url: URL?) {
    // do something
}

func audioRecorderEncodeErrorDidOccur(_ audioRecorder: AMRAudioRecorder, error: Error?) {
    // do something
}

func audioRecorderDidFinishRecording(_ audioRecorder: AMRAudioRecorder, successfully flag: Bool) {
    // do something
}

func audioRecorderDidStartPlaying(_ audioRecorder: AMRAudioRecorder) {
    // do something
}

func audioRecorderDidStopPlaying(_ audioRecorder: AMRAudioRecorder) {
    // do something
}

func audioRecorderDecodeErrorDidOccur(_ audioRecorder: AMRAudioRecorder, error: Error?) {
    // do something
}

func audioRecorderDidFinishPlaying(_ audioRecorder: AMRAudioRecorder, successfully flag: Bool) {
    // do something
}

Minimum Requirement

iOS 8.0

Release Notes

License

AMRAudioSwift is released under the MIT license. See LICENSE for details.

More Info

Have a question? Please open an issue!

amraudioswift's People

Contributors

hongxinhope avatar medisean avatar

Stargazers

MohsinAli avatar

Watchers

James Cloos avatar MohsinAli avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.