FDAAudioPlayerRecorder is Swift 5.9 library for iOS 13.0+ that allows you to play and record audio files. It is based on AVFoundation framework.
Add this dependency to your project:
https://github.com/Sfresneda/FDAAudioPlayerRecorder
Here is an example of how to use this library:
import FDAAudioPlayerRecorder
final class Foo {
var audioPlayerRecorder: FDAAudioPlayerRecorder = FDAAudioPlayerRecorder()
func play(url: URL) throws {
try audioPlayerRecorder.startPlaying(url: file.url)
}
func pause() async throws {
try await audioPlayerRecorder.stopPlaying()
}
func record() throws {
try audioManager.startRecording()
}
func stop() async throws {
try await audioManager.stopRecording()
}
}Check example project for more details.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details
Sergio Fresneda - sfresneda
