AMRAudioSwift
A useful tool to encode or decode audio between AMR and WAVE.
Install / Use
/learn @teambition/AMRAudioSwiftREADME
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 10.0
Release Notes
License
AMRAudioSwift is released under the MIT license. See LICENSE for details.
More Info
Have a question? Please open an issue!
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
