Skip to content

Vaida12345/Swift-FLAC

Repository files navigation

Swift FLAC

Swift native implementation of a FLAC reader.

Features

  • Full FLAC file & all subframe types parsing.
  • Extract PCM data from verbatim-encoded (uncompressed) FLAC files.
  • Convert verbatim-encoded (uncompressed) FLAC files to AIFF.
  • Understand parsed subframe contents.
  • Convert any FLAC file to AIFF.
  • Optimized by using customized data containers.

Example

let url = URL(fileURLWithPath: "file.flac")

// Creates a document using the given URL.
let container = try FLACContainer(at: url)

// Inspect the container using [DetailedDescription](https://github.com/Vaida12345/DetailedDescription)
detailedPrint(container)

// Inspect the metadata
detailedPrint(container.metadata)

// Gets interleaved audio data
let data = container.interleavedAudioData()

// Write the document as aiff
try container.write(to: .desktopDirectory.appending(path: "file.aiff"))

Getting Started

Swift-FLAC uses Swift Package Manager as its build tool. If you want to import in your own project, it's as simple as adding a dependencies clause to your Package.swift:

dependencies: [
    .package(url: "https://github.com/Vaida12345/Swift-FLAC.git", from: "1.0.2")
]

and then adding the appropriate module to your target dependencies.

Using Xcode Package support

You can add this framework as a dependency to your Xcode project by clicking File -> Swift Packages -> Add Package Dependency. The package is located at:

https://github.com/Vaida12345/Swift-FLAC

Documentation

This package uses DocC for documentation. View on Github Pages