Skip to content

About

Fork SwiftLAME for supporting Xcode 27+

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

This fork includes the Xcode 27 build and Swift 6 concurrency fixes.

SwiftLAME GH Banner

SwiftLAME is a lightweight Swift wrapper around the open-source LAME project for encoding audio files to MP3 format. This project was created to support the MP3 conversion feature of our Producer Toolkit macOS App.

Requirements

SwiftLAME requires Swift 6.2 or newer and supports macOS 12+ and iOS 15+.

Installation

Add the dependency to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/Tappz-GmbH/SwiftLAME.git", branch: "develop"),
]

Usage

import Foundation
import SwiftLAME

let progress = Progress()
let lameEncoder = try SwiftLameEncoder(
    sourceUrl: URL(fileURLWithPath: "/path/to/source/file.wav"),
    configuration: .init(
        sampleRate: .custom(44100),
        bitrateMode: .constant(320),
        quality: .best
    ),
    destinationUrl: URL(fileURLWithPath: "/path/to/destination/file.mp3"),
    progress: progress // optional
)
try await lameEncoder.encode(priority: .userInitiated)

The source file must remain available until encoding finishes. Use a separate encoder, destination URL, and Progress instance for each concurrent conversion.

Source Codec Support

SwiftLAME supports converting from the following codecs:

  • WAV
  • AIFF
  • Raw PCM

Notes

  • SwiftLAME is still in early alpha. There may be bugs or missing features.

License

SwiftLAME, like the LAME project, is distributed under the LGPL License.

About

Fork SwiftLAME for supporting Xcode 27+

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages