OggDecoder was created in order to convert a audio filed(ogg and oga) that are not playable by iOS AVFoundation into .wav file. It contant a two XCFramework based on liibogg(https://github.com/gcp/libogg) and vorbis(https://github.com/xiph/vorbis) framework.
OggDecoder works on the following platforms:
- iOS 13+
- Mac OSX 10.14+
To use OggDecoder with Apple's Swift package manager, add the following as a dependency to your Package.swift:
.package(url: "https://github.com/arkasas/OggDecoder.git")
Ogg decoder is designed to made a ogg/oga files converting into wav as simple as possible. To do so you have to:
- Import OggDecoder
import OggDecoder
- Decode file
let decoder = OGGDecoder()
let oggFile = oggFileURL()
decoder.decode(oggFile) { (savedWavUrl: URL?) in
// Do whatever you want with URL
// If convert was fail, returned url is nil
}
Available methods:
decoder.decode(URL) -> URL?
decoder.decode(URL, completion: (URL?) -> Void)
decoder.decode(URL, into: URL) -> bool
decoder.decode(URL, into: URL, completion: (Bool) -> Void)
OggDecoder is available under the MIT License.